From 562fed6e7e734849d071f01bf13516ee5971fe5a Mon Sep 17 00:00:00 2001 From: abaevbog Date: Fri, 12 Sep 2025 23:57:51 -0500 Subject: [PATCH] fx140: a11y fix voiceover not reading out menulist labels (#5540) Post-fx140, menulist labels in chrome windows are not announced by VoiceOver. Setting the menulist's role to 'combobox' addresses this and gets VoiceOver to announce the labels again. This is interesting because 'combobox' is supposedly menulist's implicit role, so it's not clear why this helps. It does slightly change the way VoiceOver announces menulists: it announces "combobox" instead of "popup button", but semantically combobox is still appropriate per https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only Fixes: #5424 --- chrome/content/zotero/customElements.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chrome/content/zotero/customElements.js b/chrome/content/zotero/customElements.js index 0e3b60939b..4199db45f6 100644 --- a/chrome/content/zotero/customElements.js +++ b/chrome/content/zotero/customElements.js @@ -241,6 +241,13 @@ Services.scriptloader.loadSubScript('chrome://zotero/content/elements/itemTreeMe this.removeAttribute("aria-hidden"); }); }); + // Fx140: set the menulist role to 'combobox' to fix VoiceOver no longer announcing + // menulist's label. combobox is already menulist's implicit role, so it's not clear why this helps. + // Handle this here instead of connectedCallback of menulist because that doesn't get called + // if menulist exists in the initial .xhtml (vs inserted dynamically) + if (this.parentElement && this.parentElement.localName == 'menulist') { + this.parentElement.setAttribute("role", "combobox"); + } // This event is triggered after clicking the menu and before popuphiding // where we control whether the fade out animation should run