Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenreaders swallow keyboard events #37887

Open
maxschlosser opened this issue Jan 30, 2025 · 0 comments
Open

Screenreaders swallow keyboard events #37887

maxschlosser opened this issue Jan 30, 2025 · 0 comments
Labels
Content:Accessibility Accessibility docs help wanted If you know something about this topic, we would love your help!

Comments

@maxschlosser
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Keyboard

What specific section or headline is this issue about?

Focusable elements should have interactive semantics

What information was incorrect, unhelpful, or incomplete?

This section recommends adding a keydown or keyup event to elements that can be focused using the keyboard.

However, some screenreaders and other tooling can swallow keyboard events,
notably Enter or Space and replace them with a click event,
which will break elements that don't watch for clicks.

What did you expect to see?

I would expect a hint that handling keyboard specific events might not be sufficient in some cases,
for example because they might be replaced by the accessibility tooling.

Do you have any supporting links, references, or citations?

NVDA Screenreader https://www.nvaccess.org/download/

NVDA Github Conversation: nvaccess/nvda#7898

JS Fiddle (taken from the conversation): https://jsfiddle.net/1m504ub6/1/

Do you have anything more you want to share?

While this might not be a common problem, I ran into this issue when debugging a flyout menu.
The menu uses mouseenter instead of click for activation, which is likely problematic itself.

To verify this behaviour:

  • download the NVDA Screenreader
  • open the JS Fiddle
  • with the screenreader active, focus the button and press enter: this should produce a click event
  • disable the screenreader, focus the button and press enter: this should produce a keydown event

MDN metadata

Page report details
@maxschlosser maxschlosser added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 30, 2025
@github-actions github-actions bot added the Content:Accessibility Accessibility docs label Jan 30, 2025
@maxschlosser maxschlosser changed the title Screenreaders swallow keyboardEvents Screenreaders swallow keyboard events Jan 30, 2025
@Josh-Cena Josh-Cena added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Accessibility Accessibility docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

No branches or pull requests

2 participants