-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Modal): keep focus inside opened modal, return focus to last element #2434
feat(Modal): keep focus inside opened modal, return focus to last element #2434
Conversation
/> | ||
{children} | ||
</div> | ||
<FocusLock returnFocus> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use it also in Dialogs in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, we need to maybe implement it in all the system modals and old modal, and therefore all the locks would use the same lib and can live in harmony, until all would migrate to the new modal
@@ -129,6 +129,71 @@ describe("Modal", () => { | |||
expect(mockOnClose).toHaveBeenCalled(); | |||
}); | |||
|
|||
it("traps focus inside the modal when opened", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice tests!!
6306ce0
to
26df930
Compare
16dc805
to
c56818d
Compare
5f66d89
into
feat/yossi/new-modal-building-blocks-7359960492
Focus lock
Focus should be locked inside Modal and to not let "Tab" click to focus stuff outside of the Modal
https://monday.monday.com/boards/3532714909/pulses/7360933300
Focus should return to last element that was opened before modal opened
https://monday.monday.com/boards/3532715121/pulses/7391253003