Skip to content
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

fix-body-scroll-lock-compatibility #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AntOlenin
Copy link

Hey, I use react-input-range in modal window togather with bodyScrollLock.
bodyScrollLock has event.stopPropagation(); in it's handleScroll method: https://github.com/willmcpo/body-scroll-lock/blob/master/src/bodyScrollLock.js#L136

handleScroll is being triggered by ontouchmove event. Since it has stopPropagation ontouchmove event of react-input-range is not being triggered (listeners are on document).
https://github.com/davidchin/react-input-range/blob/master/src/js/input-range/slider.jsx#L119

That's why it's not working with bodyScrollLock.

In this PR I added useCapture parameter for listeners to force capturing phase and stopPropagation for handlers which is being called when we're moving Slider only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant