Modal close button is inaccessibleSee original GitHub issue
🐛 Bug report
When using a screen reader, focusing on the close button just says “Unlabelled image” which gives no indication that it is a button, or what the button would do when interacted with.
Steps to reproduce the bug
- Enable VoiceOver or some similar screen reader
- On http://doist.github.io/reactist/?path=/story/components-modal--modal-header-only-story
- Click the button to open a modal
- Click the modal header, and press tab to focus on the close button
- VoiceOver announces that you are on an “Unlabeled image”
The user should be informed that they are focused on a close button.
- Either use a
buttonelement for the close button, or add
- Allow the Close label to be configured, or provide a default value (might not work for i18n)
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
The new modal does fix the issue. It is not yet merged, but you can close this if you want. It will be merged to beta by early next week at most.
Most probably, our modal is largely inaccessible, not only the close button. If there’s no other issue about it, I’d say we keep this issue as the one about making our modal accessible. I’m not sure if I’ll get to it this month, but both Craig and Frankie may be working in the design system components in future cycles, and this could be planned to be part of those efforts.
We’ll probably end up bringing the modal we use in Todoist, replace the Reactist one with that implementation, while also bringing the implementation closer to the design system components (e.g. using
Stack, etc. for layout, using the design system css variables, etc.)