-
Notifications
You must be signed in to change notification settings - Fork 2
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
Re-implement accessible dialogs #77
Labels
Milestone
Comments
lyzadanger
added
the
pattern library
concerning the build, structure, styling or components for the pattern library
label
May 25, 2021
Merged
lyzadanger
added
component
concerning a UI component that is part of the package API
and removed
pattern library
concerning the build, structure, styling or components for the pattern library
labels
Sep 10, 2021
lyzadanger
changed the title
Revisit
Improve accessibility and extensibility of modals, panels and dialogs
Jun 15, 2022
Dialog
component: a11y logic
This was referenced Jun 15, 2022
lyzadanger
added
project
and removed
project
component
concerning a UI component that is part of the package API
labels
Jun 15, 2022
lyzadanger
changed the title
Improve accessibility and extensibility of modals, panels and dialogs
Re-implement accessible dialogs
Feb 22, 2023
This was referenced Feb 23, 2023
This was referenced Mar 7, 2023
This was referenced Mar 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This ticket serves as a container for tasks related to making our modals and dialogs more accessible and usable. This may turn into a project at some point. This issue is not actionable at this time as written.
The
Dialog
component added here: #75 was copied over from previous implementation in theclient
(which came fromlms
).Tasks
aria-describedby
to see if we can find something a little less fragile-feelingDisabling scrolling
Consider disabling scrolling on
window.document
when modal is open.One possible implementation:
https://github.com/hypothesis/client/blob/6cae566ee5ae5d2dd88aa00954ea0f6a69dfb530/src/annotator/components/NotebookModal.js#L55-L78
Disallowing click-elsewhere or esc-to-close
There are cases when we use a Modal component in which it shouldn't be possible to close the modal without choosing an adventure (i.e. clicking a button).
"Cancel" may still be valid, and may still close the modal. But in some cases, it's problematic to have clicks outside of the modal component close the modal—e.g. in certain LMS contexts—or it's "too easy" to accidentally close a modal. And/or the close button (X) is misleading or distracting.
Before we do this, we need to look into proper focus-trapping (see Keyboard Support section of https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/dialog.html).
One implementation approach that's been looked at here involves updating the
useElementShouldClose
hook to be configurable.Initial focus to...?
Might be helpful to set initial focus on an action button of some sort?
The text was updated successfully, but these errors were encountered: