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

Bug - [Modal] - models incorrectly mark dom nodes with aria-hidden="true" #11041

Closed
christianvogt opened this issue Sep 20, 2024 · 0 comments · Fixed by #11207
Closed

Bug - [Modal] - models incorrectly mark dom nodes with aria-hidden="true" #11041

christianvogt opened this issue Sep 20, 2024 · 0 comments · Fixed by #11207
Assignees
Labels
Milestone

Comments

@christianvogt
Copy link
Contributor

Describe the problem
Modal components incorrectly update the aria-hidden attribute of the root and siblings.

When a modal is open, the root and all siblings should have aria-hidden="true" except for the modal container.

When using React.StrictMode along with a useEffect somewhere in the app hierarchy, the double rendering effect of strict mode causes the open modal to have aria-hidden="true" when it shouldn't.

Also when using React.StrictMode a new div is appended to the DOM which is never removed until the page is refreshed.

Finally if there are multiple Modals rendered with isOpen={false} and one of them is opened, the root and all siblings lose their attribute aria-hidden="true".

When using Cypress for testing, selectors will fail to find elements within a hidden element if aria-hidden="true". This prevents our developers from using cypress against a dev env and allowing them to develop and run their cypress tests against their dev app.

How do you reproduce the problem?
Here's a sandbox with all the use cases.
https://codesandbox.io/s/withered-frog-qc67dn?file=/index.js

Expected behavior
Using React.StrictMode should have no bearing on the correct functionality of the Modal component. It should work as expected in or out of this mode.

Is this issue blocking you?
Yes.
Unable to run our cypress tests within a development environment which is using React.StrictMode.

Work around is to edit the app and remove strict mode however that is not a viable solution all the time.
Alternatively, devs can run cypress against a production build which takes much longer to iterate with during development.

What is your product and what release date are you targeting?
RHOAI

Any other information?

@github-project-automation github-project-automation bot moved this to Needs triage in PatternFly Issues Sep 20, 2024
@tlabaj tlabaj moved this from Needs triage to On deck in PatternFly Issues Oct 3, 2024
@tlabaj tlabaj added this to the 2024.Q4 milestone Oct 3, 2024
@tlabaj tlabaj self-assigned this Oct 16, 2024
@kmcfaul kmcfaul moved this from On deck to Not started in PatternFly Issues Oct 16, 2024
@kmcfaul kmcfaul removed the bug label Oct 25, 2024
@kmcfaul kmcfaul modified the milestones: 2024.Q4, Patch release Oct 25, 2024
@github-project-automation github-project-automation bot moved this from PR Review to Done in PatternFly Issues Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants