-
Notifications
You must be signed in to change notification settings - Fork 337
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
Calling enableBodyScroll can disable body scroll depending on situation #74
Comments
So the problem is you don't want the original setting to be restored when
you call enableBodyScroll?
If that's the case, we could pass a flag to enableBodyScroll to instruct it
to not restore settings saved when disabledBodyScroll was called.
Thoughts? PR welcome as well!
…On Sat, Nov 17, 2018, 6:14 AM Martin Barri ***@***.***> wrote:
Hey there, thank you for this cool library.
So the issue can be reproduced with the code below:
disableBodyScroll(targetElement)
setTimeout(() => {
document.body.removeAttribute('style')
}, 100)
setTimeout(() => {
enableBodyScroll(targetElement) // this will disable scrolling
}, 200)
In my case, I'm using material-ui where it's Dialog component already
handles setting/removing of overflow: hidden on document.body and
therefore end up in a similar situation as above. Sadly this css trick
alone does not cancel scrolling on iOS and was hoping to use this library.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#74>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ANLxOvuSd98k2h5piFVbOFm1k107s9Lfks5uvw6wgaJpZM4Ym0RF>
.
|
Hey, thanks @willmcpo for the quick response! Elaborating on my scenario The issue Suggestion Demo |
Since this is a compatibility issue with handling of |
I see that you already forward the
|
from a quick glimpse, seems ok and intuitive. would you mind putting that in a PR ? =) 👍 |
Hey there, thank you for this cool library.
So the issue can be reproduced with the code below:
In my case, I'm using material-ui where it's Dialog component already handles setting/removing of
overflow: hidden
ondocument.body
and therefore end up in a similar situation as above. Sadly this css trick alone does not cancel scrolling on iOS and was hoping to use this library.The text was updated successfully, but these errors were encountered: