wave
wave copied to clipboard
Modal window must capture the keyboard focus
When the modal is shown, a user can move focus between its elements using the Tab button. But when we run out of the focusable elements in the modal, the focus moves to the content below.
We must follow WAI ARIA best practices and trap the focus inside the modal.
Codesanbox example shows an app with two inputs — one on the main page and another one in the modal window. When the modal is opened and the focus is on in-modal input, you can still press Shift+Tab to go outside the modal. This is incorrect behaviour, the focus must be trapped inside the modal window
@nlopin can you add like a loom video demonstrating the issue better? thanks
Thanks for reaching out, I've updated the description 👍