From 844cbc72157acdc1da0f90aab83b0f67d0a8a029 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Mon, 26 Feb 2024 11:22:59 +0100 Subject: [PATCH] fix(NcActions): provide a label in dialog role Signed-off-by: Grigorii K. Shartsev --- src/components/NcActions/NcActions.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/NcActions/NcActions.vue b/src/components/NcActions/NcActions.vue index f03ac06bcc..4523c9b13e 100644 --- a/src/components/NcActions/NcActions.vue +++ b/src/components/NcActions/NcActions.vue @@ -1723,6 +1723,7 @@ export default { }, }) ) + const triggerRandomId = `${this.randomId}-trigger` return h('NcPopover', { ref: 'popover', @@ -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, @@ -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,