Skip to content

Commit

Permalink
fix(menubar): Add aria-selected and aria-activedescendant to menu bar…
Browse files Browse the repository at this point in the history
… items (fix #3911)

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Oct 20, 2023
1 parent 9a589e6 commit 15ae86a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Menu/ActionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
v-bind="state"
:container="menuIDSelector"
:aria-label="actionEntry.label"
:aria-activedescendant="currentChild ? `${$menuID}-child-${currentChild.key}` : null"
:force-menu="true"
:name="actionEntry.label"
:data-text-action-entry="actionEntry.key"
Expand All @@ -37,6 +38,7 @@
</template>
<ActionSingle v-for="child in children"
:key="`child-${child.key}`"
:id="`${$menuID}-child-${child.key}`"

Check warning on line 41 in src/components/Menu/ActionList.vue

View workflow job for this annotation

GitHub Actions / eslint

Attribute ":id" should go before ":key"
is-item
:action-entry="child"
v-on="$listeners"
Expand Down
1 change: 1 addition & 0 deletions src/components/Menu/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const getActionState = (actionEntry, $editor) => {
disabled: isDisabled(actionEntry, $editor),
class: getEntryClasses(actionEntry, active),
active,
'aria-selected': active,
}
}

Expand Down

0 comments on commit 15ae86a

Please sign in to comment.