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)
adamkudrna
left a comment
There was a problem hiding this comment.
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 |
bedrich-schindler
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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 |
adamkudrna
left a comment
There was a problem hiding this comment.
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