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

Dialog - useBodyOnScroll - Fix for nested dialogs case #2794

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

matzimowski
Copy link
Contributor

@matzimowski matzimowski commented Jan 15, 2024

before

two dialogs are open. one is nested in another. both are closed at the same time. "sg-dialog-no-scroll" class is not removed from the document body and the whole page cannot be scrolled (due to manyDialogsOpened condition).

after

two dialogs are open. one is nested in another. both are closed at the same time. "sg-dialog-no-scroll" class is removed from the document body and the whole page is working as expected.

Note:
An Issue created to introduce an ultimate solution for nested components

Copy link
Contributor

@bartoszlorek bartoszlorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would implement the useBodyNoScroll with the context to be aware of the nested state. https://www.aleksandrhovhannisyan.com/blog/react-context-nested-components/

@matzimowski
Copy link
Contributor Author

matzimowski commented Jan 16, 2024

I would implement the useBodyNoScroll with the context to be aware of the nested state. https://www.aleksandrhovhannisyan.com/blog/react-context-nested-components/

👌 i created this #2795 issue to handle it the way you suggested, thank you!

@matzimowski matzimowski enabled auto-merge (squash) January 16, 2024 07:55
@matzimowski matzimowski merged commit fde1686 into master Jan 16, 2024
2 checks passed
@matzimowski matzimowski deleted the Dialog---useBodyOnScroll---Fix-for-nested-dialogs branch January 16, 2024 07:59
@matzimowski matzimowski mentioned this pull request Jan 16, 2024
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.

None yet

3 participants