-
Notifications
You must be signed in to change notification settings - Fork 791
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
fix(aria-hidden-focus): mark as needs review if a modal is open #1995
Conversation
} | ||
|
||
axe._cache.set('isModalOpen', undefined); | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this returning true | undefined instead of just true | false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about returning false but I didn't want it to seem like the test was accurate and could say "false" meant a modal was not open. Undefined kinda help make the check feel more uncertain that we're not even sure if a modal is open or not.
The rule will now return as needs review if there are focusable elements present while what we believe to be a modal is open. On the react example, it will now return as needs review rather than failing when the modal is open that traps focus https://react-bootstrap.github.io/components/modal/#modals-live.
Closes issue: #1482
Reviewer checks
Required fields, to be filled out by PR reviewer(s)