-
Notifications
You must be signed in to change notification settings - Fork 808
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
Accessibility issues with the codepen demos #955
Comments
Lastly, all codepen demo modals seem to lack |
@patrickhlauke Many examples are outdated. The issue with |
I'm looking for a first issue to tackle and wouldn't mind taking this one. Couple questions though:
|
@neilhsmith A good place to start is to update the available examples using the correct accessibility functionality. Other examples would be really nice, specially combining libraries like styled components and others to see how react-modal is compatible. This will help investigate bugs... |
Cool, thanks. I'll take a crack at it. |
Great. Let me know if you need anything. |
Apologies for the delay but I have an updated collection here. I removed the I'll open a PR but I have plans to add at least one more example later today for tailwind so I wanted to update you here in case you have opinions. |
Summary:
Many of the demos linked to from the README have accessibility issues:
aria-hidden="true"
is set on the<body>
. this also hides the modal itself (which is a child element of the<body>
) from screen readers; when the modal is closed, focus is not returned explicitly to the "Trigger modal" button#1 modal
is fine, when triggering#2 modal
the<body>
is once again hidden witharia-hidden="true"
and, as a result, the#2 modal
is also hidden from screen readersSteps to reproduce:
Expected behavior:
aria-hidden="true"
on the<body>
itself, as this will hide everything from screen readers, including the dialogReview how the working demos like Using inline styles do it, and apply the same behavior to the broken demos.
The text was updated successfully, but these errors were encountered: