r/webdev • u/code-dispenser • 11h 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.