Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
When a modal is displayed, with a backdrop, it is not possible via mouse to interact with any other parts of the UI. The user is effectively trapped within the modal and has to close the modal before being able to click links, buttons, etc. on the page below.
The same should be true when using keyboard for navigation: when the modal is displayed it should not be possible to use the tab-key to get to other UI elements below the modal. Before this change, that was possible to do.
I've added a focus trap, that will make sure that when the last focusable element in the modal is reached, the next tab-keypress takes you back to the first focusable element in the modal. So it's not possible to get to the other UI elements of the page below without first closing the modal properly.
Checklist before requesting a review
stories
-folder?packages/react/index.tsx
?packages/css/index.css
?