Skip to content
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

fix: use shared modal manager to sync container state #5917

Merged
merged 3 commits into from
Jul 15, 2021

Conversation

kyletsang
Copy link
Member

Fixes #5905

This fix uses a shared ModalManager between Offcanvas and Modal in order to sync the container state in the scenario where you can trigger the closing/opening of both Offcanvas and Modal at the same time. In the case where the Offcanvas has the scroll prop set to true, we use a local ModalManager because the shared one handles overflow styles. I think this should be ok since we don't need to modify the container styles when scroll is true.

This also fixes some differences in behavior compared to upstream bootstrap where enforce focus should not be enabled when scroll is enabled for Offcanvas. The user should be able to select text, or focus outside. In addition, clicking outside Offcanvas should not close the Offcanvas when backdrop is false: https://getbootstrap.com/docs/5.0/components/offcanvas/#backdrop

@kyletsang kyletsang requested a review from jquense July 10, 2021 00:10
@kyletsang kyletsang merged commit 46eb1bb into master Jul 15, 2021
@kyletsang kyletsang deleted the fix/shared-modal-manager branch July 15, 2021 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closing Offcanvas when opening a Modal removes vertical scrollbar
2 participants