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

Disable focus trap & disable tab trap #876

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bvellacott
Copy link

@bvellacott bvellacott commented May 21, 2021

Fixes #[issue number].

Changes proposed:

  • add ability to disableFocusTrap
  • add ability to disableTabTrap

Acceptance Checklist:

  • The commit message follows the guidelines in CONTRIBUTING.md.
  • Documentation (README.md) and examples have been updated as needed.
  • If this is a code change, a spec testing the functionality has been added.
  • If the commit message has [changed] or [removed], there is an upgrade path above.

@coveralls
Copy link

coveralls commented May 21, 2021

Coverage Status

Coverage decreased (-0.3%) to 84.777% when pulling afada57 on bvellacott:disableFocusTrap-&-disableTabTrap into 827796d on reactjs:master.

@bvellacott
Copy link
Author

#799

if (instances.length > 0) {
const trapFocus = instances.find(({ props }) => !props.disableFocusTrap);

if (trapFocus && instances.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we open one modal with focus trap disabled and one that's enabled?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then a focus trap will exist. I thought that is the best way to do it as it gives existing functionality priority over the added functionality. I could add something in the readme to let the user know?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment in the readme about this

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

3 participants