-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: trap focus in opened modal (#2278)
### 🎯 Goal When a modal dialog is displayed in chat, it's still possible to `Tab` your way through the focusable elements outside of the modal. The common practice is to "trap" the focus inside the modal, so that `Tab` cycles through the focusable elements inside the modal only. ### 🛠 Implementation details Implementing focus trap properly is not as easy as it seems - so it's better to use a proven solution. This PR uses `FocusScope` from React Aria. ### 🎨 UI Changes https://github.com/GetStream/stream-chat-react/assets/975978/a6ac10f0-b4a9-44b2-9beb-2a822ceb0ab2
- Loading branch information
1 parent
706cf3d
commit 8f48b52
Showing
4 changed files
with
170 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters