-
Notifications
You must be signed in to change notification settings - Fork 7
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
Prevent page from scrolling when Modal
is open and implement focus trap (#397)
#432
Conversation
362a9c2
to
02e62df
Compare
Modal
is open (#397)
Please, fix commit message to: |
Ready for next round, thanks! @adamkudrna @bedrich-schindler @dacerondrej @mbohal |
bf27f58
to
6eafb35
Compare
Modal
is open (#397)Modal
is open and enforce focus (#397)
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.
Nicely done! 👏🏻 My major comments are:
- focus trap vs. focus enforce,
- code readability because of long hooks.
Modal
is open and enforce focus (#397)Modal
is open and implement focus trap (#397)
Should be ready for hopefully the final round. @bedrich-schindler @adamkudrna |
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.
Great job, thank you! 👏🏻
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.
I would approve it as it is. But there are some opened topics to be resolved. When they are resolved, I will approve it.
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.
I would approve it as it is. But there are some opened topics to be resolved. When they are resolved, I will approve it.
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.
I would approve it as it is. But there are some opened topics to be resolved. When they are resolved, I will approve it.
@bedrich-schindler should be ready for approval |
Modal now always traps focus. Based on the recent discussion, we leave the option to disable autoFocus for cases in which user doesn't want the long content inside Modal to automatically scroll to the autoFocused element. |
5aaafad
to
1119744
Compare
I tested it and it works as expected. I checked code just slightly as I have already seen it. This PR was discussed primarily with @adamkudrna and @mbohal , so I expect them to check it detaily |
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.
Cool! I only tweaked a last little detail regarding scrolling and autofocus, and it's ✅.
I am not that confident of this implementation. Any suggestions are welcome. @adamkudrna
Closes #397