Open
Description
Summary:
When writing tests using react-testing-library, tabbing does not work properly when inside of a react-modal.
Steps to reproduce:
- Render a Modal with some tabbable elements
- Try to tab between elements using @testing-library/user-event userEvent.tab()
- The focused element does not change 😢
Expected behavior:
The focused element changes when calling userEvent.tab()
inside of a react-modal.
Link to example of issue:
https://codesandbox.io/s/xenodochial-mestorf-qx6j8?file=/src/__tests__/index.js
Additional notes:
I'm aware the issue could be in the user-event library, so I made a companion issue over there (clicky). I'm also thinking I could just need more understanding of how the focus trapping is working in react-modal / user-event so I can get them to play together nicely.