-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[RFC] useFreezeScroll #2473
Comments
18 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's very challenging to avoid layout shift when you remove the scrollbar from the window. Many UI libraries still face issues with this, experiencing layout shifts when they open a modal or freeze scroll in some way. After testing numerous approaches I found an approach that avoids layout shifts while removing the scrollbar and freezing the scroll.
The useFreezeScroll hook freezes the scroll and removes the scrollbar from the browser window when it is active, without causing any layout shifts. This is particularly useful, for example, when a modal is opened.
The text was updated successfully, but these errors were encountered: