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

fix(aria-hidden-focus): mark as needs review if a modal is open #1995

Merged
merged 6 commits into from Jan 30, 2020

Conversation

straker
Copy link
Contributor

@straker straker commented Jan 22, 2020

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)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@straker straker requested a review from a team as a code owner January 22, 2020 18:01
lib/checks/keyboard/focusable-disabled.js Outdated Show resolved Hide resolved
lib/checks/keyboard/focusable-not-tabbable.js Outdated Show resolved Hide resolved
lib/rules/aria-hidden-focus.json Show resolved Hide resolved
lib/checks/keyboard/focusable-modal-open.js Outdated Show resolved Hide resolved
lib/commons/dom/is-modal-open.js Outdated Show resolved Hide resolved
lib/commons/dom/is-modal-open.js Show resolved Hide resolved
lib/commons/dom/is-modal-open.js Outdated Show resolved Hide resolved
test/commons/dom/is-modal-open.js Outdated Show resolved Hide resolved
test/commons/dom/is-modal-open.js Outdated Show resolved Hide resolved
}

axe._cache.set('isModalOpen', undefined);
return undefined;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants