react-scroll-wheel-handler
react-scroll-wheel-handler copied to clipboard
prevent scroll is not working in mobile
I tried this package. I used the prevent scroll attribute. It is working fine in desktop but when i am trying in my mobile I was able to scroll. It is not supported in mobile?
Hi, as you can see in this line
https://github.com/Etto91/react-scroll-wheel-handler/blob/98ac9eafafb81846b65adad33edeaedd024d943a/src/ReactScrollWheelHandler.js#L63
preventScroll prop is only used in the wheel event.
Is there anyway to prevent user scrolling even in mobile?
if you can, could you exactly tell me what you want to do?
Hi @Etto91 , the package is great and really useful. I was going to open a new issue but saw that this one is really similar. I think that what the other user is saying is that it would be useful to also prevent scrolling when the user swipes.
Maybe it could be a different prop preventScrollSwipe, so that one can choose if the UX is the same when scrolling with the wheel or when swiping in a touch device.
Other thing, taking into account accesibility issues, would be to also be able to prevent scroll when using the keyboard, so that the UX is also the same for those users. This could also be a separate prop.
Hi @eliezerbaschkier, thanks for clearing that up. When I have some time I'll do this enhancement. if you want feel free to open a pr :)