When writing a test using @testing-library/react and @testing-library/user-event, I am unable to get userEvent.tab()
to work inside of the React Modal component. I think it may have something to do with passing the correct focusTrap
argument to the tab
function, but I have been unable to get it to work.
Here's a link to a CodeSandbox with a minimum reproduction of the issue: link
How can I use user-event to tab between elements inside of a react-modal?