Fix the sidebar meta boxes toggle aria-expanded reporting for Firefox+NVDA #1556
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
See #1387 and #1388, then reverted in #1537.
Firefox and NVDA don't announce the
aria-expanded
state change (expanded/collapsed) on the sidebar meta boxes toggles. The previous attempt to fix this with HTML/CSS broke the icon buttons when used in other context, my bad.However, it would be great to find an alternative workaround, since Firefox/NVDA users don't get absolutely any feedback when the
aria-expanded
state changes. Yes, this is a mix of browser and screen reader bug and, ideally, it should be fixed upstream. Unfortunately, the tickets related to the Firefox bug appear to be pending since a few years and I'm afraid a resolution won't happen so soon.Fully understanding the issue is a good first step, some references:
nvaccess/nvda#5247
nvaccess/nvda#6401
https://bugzilla.mozilla.org/show_bug.cgi?id=659886
https://bugzilla.mozilla.org/show_bug.cgi?id=1285862
In a few words, when Firefox repaints some elements, for example because some CSS generated or SVG icon changes, it also updates the complete set of accessible properties (the "accessible") exposed to screen readers. It shouldn't do this.
Quoting from nvaccess/nvda#6401
Based on this, I've experimented what seems to me a logical workaround: just make the two events happen at a different time. Slightly delaying the
aria-expanded
state update, seems to fix it because the "accessible" regeneration happen first, and then Firefox fires a stateChange.PR incoming soon.
The text was updated successfully, but these errors were encountered: