body-scroll-lock
body-scroll-lock copied to clipboard
add touchmove event listener to document.body
fixes body-scroll-lock for ios safari
What's going on on line 55/56? Surely thats not right?
No it isnt, i've updated
Hi @diachedelic, any chance this gets released soon? Looks like we experience similar issues on iOS currently.
@natterstefan @phelma hey all, can someone explain exactly why this patch is needed? Which versions of iOS safari require it? It certainly worked on previous versions.
any news on the topic? the library stopped working for us as well on IOS (both chrome and safari) and it was working some time ago even though the demo page seems to work correctly even today, maybe is a problem that presents itself on non trivial use cases with a slightly more complex DOM structure. I guess the demo page could have a modal implemented using a react portal (most likely one of the most common use cases) to check if it works correctly.
update: for what is worth I've forked the lib in my code and the changes in this PR seems indeed to fix the problem on IOS
@axyz thanks for the testing. Do you know what triggered locking to suddenly stopped working? What changed - did you upgrade body-scroll-lock
, or your version of iOS? The lib seems to work fine for me on the iOS 12.2 simulator, with my fairly complex use case. Are you able to downgrade iOS and see if locking works again?
I'm sorry but I feel we need more clarity on this. The issues #102 and #103 referenced above seem unrelated.
@diachedelic at the beginning I think it was my fault: I was using the @zeix scoped version, maybe a warning on the README can be useful as the npm repo link point on the same place.
But then after upgrading to real latest version it fixed the problem of a full screen modal, but I was still able to scroll down (but not up, weirdly) in case of non fullscreen content.
I'm sorry I cannot give more detailed information, but we just noticed this now as with a full screen modal was much less noticeable to have the underlying content to scroll
Can someone provide a demo page with a Modal that's not working in IOS?
If that can be done, then I can help test/verify that this fix is good.
It'd be nice to get to the bottom of this.
And also, does the solution posted in https://github.com/willmcpo/body-scroll-lock/issues/102 help? If so, is this PR's fix still needed?
#102 doesn't solve this for me
for those where it's not working, some code snippets to support the need for this PR would be helpful.
Otherwise, the mentioned problems will be assumed to be non-issues.
@willmcpo I've tested the changes in this PR and they also fix the issue I was having on iOS in which the scroll was not locking on Safari mobile.