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

How to make draggable area to be on the handle only? #16

Closed
henrikra opened this issue Aug 22, 2020 · 4 comments · Fixed by #17 or #21
Closed

How to make draggable area to be on the handle only? #16

henrikra opened this issue Aug 22, 2020 · 4 comments · Fixed by #17 or #21
Labels
enhancement New feature or request

Comments

@henrikra
Copy link

First of all this is very good library but I have one UX problem in mind.

Specially when using with mobile if you have list of different ReactCompareSliders which take full width of the mobile screen it is annoying to scroll list vertically because you accidentally start sliding the ReactCompareSlider even though you wanted to scroll content of the page vertically.

So would be nice to restrtict the area of ReactCompareSlider so that only if user drags the handle then it starts to drag ReactCompareSliders content horizontally. What do you guys think?

@nerdyman
Copy link
Owner

Hi @henrikra,

That's definitely a good idea. An additional prop could be added to make only the handle draggable, maybe something like onlyHandleDraggable? Then the event listeners could be moved to the handle instead of the container.

@nerdyman nerdyman added the enhancement New feature or request label Aug 22, 2020
@henrikra
Copy link
Author

Sounds good to me 👍

nerdyman added a commit that referenced this issue Aug 27, 2020
@nerdyman nerdyman linked a pull request Aug 27, 2020 that will close this issue
4 tasks
@nerdyman
Copy link
Owner

nerdyman commented Sep 7, 2020

@henrikra This has been added in 1.2.0. The default handle doesn't work that well with this setting enabled because of its width. I'll be publishing v2 of this library in the coming weeks to fix this along with a few other features. In the meantime, you could use your own custom handle.

The library doesn't automatically detect touch devices but I've added docs on how to detect touch devices if you haven't already got something configured.

Thanks for opening the issue, if it's not working as you expected (with the caveat above for the default handle) feel free to reopen the issue.

@henrikra
Copy link
Author

@nerdyman Thx! Now I have tested the new version and it works like a charm!

@nerdyman nerdyman linked a pull request Dec 7, 2020 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants