Skip to content

Commit

Permalink
Merge pull request #5308 from nextcloud-libraries/fix/nc-actions--dia…
Browse files Browse the repository at this point in the history
…log-attrs

fix(NcActions): provide a label in dialog role
  • Loading branch information
ShGKme committed Feb 26, 2024
2 parents 55644fc + 844cbc7 commit cc5e140
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,7 @@ export default {
},
})
)
const triggerRandomId = `${this.randomId}-trigger`
return h('NcPopover',
{
ref: 'popover',
Expand Down Expand Up @@ -1766,6 +1767,7 @@ export default {
slot: 'trigger',
ref: 'menuButton',
attrs: {
id: triggerRandomId,
'aria-label': this.menuName ? null : this.ariaLabel,
// 'aria-controls' should only present together with a valid aria-haspopup
'aria-controls': this.opened && this.config.popupRole ? this.randomId : null,
Expand Down Expand Up @@ -1798,7 +1800,8 @@ export default {
id: this.randomId,
tabindex: '-1',
role: this.config.popupRole,
// TODO: allow to provide dialog aria-label
// Dialog must have a label
'aria-labelledby': this.actionsMenuSemanticType === 'dialog' ? triggerRandomId : undefined,
},
}, [
actions,
Expand Down

0 comments on commit cc5e140

Please sign in to comment.