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

Focus trapping stops working #130

Closed
mkarajohn opened this issue Mar 27, 2019 · 2 comments
Closed

Focus trapping stops working #130

mkarajohn opened this issue Mar 27, 2019 · 2 comments

Comments

@mkarajohn
Copy link

mkarajohn commented Mar 27, 2019

CodeSandbox link (better see it in its own tab)

Bug description

  • We have 2 siblings DialogOverlay components (DialogOverlay 1 and 2)
  • We open 1
  • Keyboard navigation keeps focus trapped inside DialogOverlay 1
  • We open 2 while 1 is still open
  • Keyboard navigation keeps focus trapped inside DialogOverlay 2
  • Close 2
  • Keyboard navigation does not keep focus trapped inside DialogOverlay 1, focus escapes the overlay component

Expected behaviour

Focus trapping for each DialogOverlay should not be affected by other DialogOverlays

Notes

Could be related to #83 (comment) ?

@simonccarter
Copy link

If you update the @reach/dialog dependency in the codesandbox example from 0.1.4 to 0.2.9, the problem goes away. Possibly fixed by moving to react-focus-lock. I think this can be closed now?

@mkarajohn
Copy link
Author

Yep, just checked, it's fixed. In the end, react-focus-lock is what I opted to use in my project as well.

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

No branches or pull requests

2 participants