Skip to content

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

@lauri-kaariainen

Description

@lauri-kaariainen

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions