react-scrolllock
react-scrolllock copied to clipboard
TouchScrollable working only with vertical scrolling
If we have an element with horizontal scrolling, it is possible to force TouchScrollable to scroll an element only by forcing not only the width limit, but also the height limit, in which the nested block must be at least 1 pixel more, then it works.
Please provide a CodeSandbox reproduction.
I marked the place where you need to change the value to enable scroll https://codesandbox.io/s/8pnlp437v8
I'm seeing this in mobile devices where the height of a modal with a slideshow and captions is taller than the viewport height, if it's smaller than the viewport height it scrolls horizontally just fine, as soon as it hits a slide with content that's too tall swiping stops working
disabling scrollock in mobile is my current workaround
also want to add that before disabling touch scrollable for mobile, I was doing tests thinking that it was some bug with the slider script, so I started by trying to manually trigger the previous/next methods of the slider by listening in on the touchstart/touchend events, only touchstart would fire. will try to recreate a sandbox once I have some free time but wanted to share this in the meantime in case it helps somehow
relates to #42 Library seems abandoned though
And also here is mine pull request with fix of current issue #98
They stopped the repairs. I had to do it myself, in the same way, with a new version of typeScript. And fix these problems for everyone to use. add react hooks、vue3 example
npm i body-scroll-lock-upgrade
repair log,Refer to the releases page.