-
Notifications
You must be signed in to change notification settings - Fork 560
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 scroll on parent when dialog is open #98
Comments
It should be handled by Dialog itself. That's a feature - they browser is focusing on the input, to provide a better UX... but not. https://stackoverflow.com/questions/14492613/ios-ipad-fixed-position-breaks-when-keyboard-is-opened |
Yeah I want this. I've seen solutions where the screen jumps because the scroll bar gets removed (add overflow: hidden to the body). I haven't had a chance to research other ways to do it that avoid the jump. Open to suggestions. Here's the spectrum thread on the same topic: https://spectrum.chat/reach/general/modal-dialog-should-lock-focus~3cd21c66-6c3d-4b73-adcb-10856a44eadd |
(also, happy to merge a PR that simply adds |
Please don't. |
@theKashey What is your solution then? |
Could https://github.com/willmcpo/body-scroll-lock be a good alternative, either by copying their approach or using it as a dependency? |
@sjelfull - @ryanflorence - mine solution nowadays would block any interactions with portaled content, ie |
#111 has an issue with scroll locking: #161 (upstream theKashey/react-remove-scroll#4). |
Note: If you use |
Not sure how it looks like, but |
Additionally... If you use |
Could Dialog prevent scroll on body when open, or is that up to the app?
The text was updated successfully, but these errors were encountered: