Skip to content

Commit 5607538

Browse files
Add ARIA labels to beta menu btns without text
1 parent 61ee43a commit 5607538

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

src/scripts/ui/components/button.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ export class ComfyButton implements ComfyComponent<HTMLElement> {
102102
this.element.removeAttribute('title')
103103
}
104104
})
105+
if (tooltip !== undefined) {
106+
this.element.setAttribute('aria-label', tooltip)
107+
}
105108
this.classList = prop(this, 'classList', classList, this.updateClasses)
106109
this.hidden = prop(this, 'hidden', false, this.updateClasses)
107110
this.enabled = prop(this, 'enabled', enabled, () => {

src/scripts/ui/components/splitButton.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,21 @@ export class ComfySplitButton {
2929
this.element = $el(
3030
'div.comfyui-split-button' + (mode === 'hover' ? '.hover' : ''),
3131
[
32-
$el('div.comfyui-split-primary', primary.element),
33-
$el('div.comfyui-split-arrow', this.arrow.element)
32+
$el(
33+
'div.comfyui-split-primary',
34+
{
35+
ariaLabel: 'Queue current workflow'
36+
},
37+
primary.element
38+
),
39+
$el(
40+
'div.comfyui-split-arrow',
41+
{
42+
ariaLabel: 'Open extra opens',
43+
ariaHasPopup: 'true'
44+
},
45+
this.arrow.element
46+
)
3447
]
3548
)
3649
this.popup = new ComfyPopup({

src/scripts/ui/menu/workflows.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export class ComfyWorkflowsMenu {
4747
this.buttonProgress
4848
]),
4949
icon: 'chevron-down',
50-
classList
50+
classList,
51+
tooltip: 'Click to open workflows menu'
5152
})
5253

5354
this.element.append(this.button.element)
@@ -85,6 +86,7 @@ export class ComfyWorkflowsMenu {
8586
const active = this.app.workflowManager.activeWorkflow
8687
this.button.tooltip = active.path
8788
this.workflowLabel.textContent = active.name
89+
this.workflowLabel.ariaLabel = `Active workflow: ${active.name}`
8890
this.unsaved = active.unsaved
8991

9092
if (this.#first) {
@@ -523,6 +525,7 @@ export class ComfyWorkflowsContent {
523525
$el('i.mdi.mdi-18px.mdi-magnify'),
524526
$el('input', {
525527
placeholder: 'Search',
528+
role: 'search',
526529
value: this.filterText ?? '',
527530
oninput: (e: InputEvent) => {
528531
this.filterText = e.target['value']?.trim()

0 commit comments

Comments
 (0)