wave icon indicating copy to clipboard operation
wave copied to clipboard

Modal window must capture the keyboard focus

Open nlopin opened this issue 3 years ago • 2 comments

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 avatar May 11 '21 09:05 nlopin

@nlopin can you add like a loom video demonstrating the issue better? thanks

lloydaf avatar Jun 14 '23 20:06 lloydaf

Thanks for reaching out, I've updated the description 👍

nlopin avatar Jun 19 '23 07:06 nlopin