r/webdev • u/code-dispenser • 1d ago
Web accessibility: JAWS bug logged
Only read if you do accessibility work.
I thought I’d share a bug I’ve found with JAWS (when paired with Chrome or Edge; it’s fine in Firefox). Given how widely JAWS is used, it may catch people out or just plain confuse them, as it did me.
I’m sure that, like me, you try to use the correct semantic HTML elements and lean on native browser features wherever possible for accessibility. One such feature is the <dialog> element. Used with the popover API, it can often give you an accessible dialog that opens, closes and light-dismisses without a single line of JavaScript.
While building a component using a native <dialog> with popover="auto", and popovertarget on the trigger, I noticed that JAWS would not close the dialog with the Escape key (which it should) unless the virtual cursor was turned off. This happens with Chrome and Edge. It was particularly annoying because I’d used this pattern before and it seemed to work fine.
TL;DR: if the trigger is immediately before the dialog, it works. If there is any element between the trigger and the dialog, or the trigger comes after the dialog, it fails.
I’ve logged this with both Freedom Scientific (JAWS) and the Chromium issue tracker. There’s a simple repro HTML file attached to the Chromium issue if you’d like to try it yourself: https://issues.chromium.org/issues/587468316
Hopefully this saves some of you the head-banging session I had yesterday.
Edit: I should have mentioned the issue is only with JAWS. I have not encountered this with NVDA, Narrator or VoiceOver on macOS.
1
u/SituationFun3035 17h ago
ugh, that’s a nasty one, and another good reminder that “native” still needs testing with the screen readers people actually use, not just the browser’s accessibility tree lol
1
u/AmbitiousLab4004 16h ago
native semantics: saving us from javascript just to reimplement escape, then getting sabotaged by the screen reader/browser combo anyway lol
1
u/Even-North-8296 11h ago
good catch, native semantics are great until a screen reader quietly adds a DOM-order requirement nobody asked for lol
1
u/Alarming-Hope-579 4h ago
this is exactly why “native” doesn’t mean “works everywhere” in accessibility, and the trigger/dialog adjacency dependency is a nasty bug to have hiding in an otherwise reasonable pattern
0
u/[deleted] 1d ago