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

Doesn't work correctly with range input in vertical orientation #9

Open
lauri-kaariainen opened this issue Nov 16, 2017 · 3 comments
Open

Comments

@lauri-kaariainen
Copy link

lauri-kaariainen commented Nov 16, 2017

On touch device the "thumb" moves up-down per the touch on the left-right line, as opposed to up-down track, as it should (I hope this made sense).

Fixed it in my own version, will have to see if I have time for PR.

Fix pretty much:
where it says this from around line 176 in src/js/rangetouch.js:

// Determine left percentage


percent = ((100 / clientRect.width) * (touch.clientX - clientRect.left));

put this after it:

// Determine top percentage


percent = ((100 / clientRect.height) * ((clientRect.height-touch.clientY) -(clientRect.top)));


percent = 100-((100 / (clientRect.height)) * (touch.clientY-clientRect.top))


percent = 100 - 100 / clientRect.height * (touch.clientY - clientRect.top);

of course you would need some way (maybe conf flag) to decide which value to use

you'll maybe want to set also

window.rangetouch.set("thumbWidth", 0);

@minh-huyen
Copy link

hey @lauri-kaariainen, I would love to know how you fixed it on your version. cause I am facing the same situation

@lauri-kaariainen
Copy link
Author

lauri-kaariainen commented Jun 12, 2018

hey I fixed the above message with the latest code that worked for me. Downside of course is it doesn't work anymore in horizontal orientation with that there.

@minh-huyen
Copy link

hey @lauri-kaariainen thanks for the updated info and code! that is a pity for sure when both orientations cant be used at the same time.

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

No branches or pull requests

2 participants