leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.67k stars 659 forks source link

Slider value does not increment on mobile devices #40

Closed codecowboy closed 11 years ago

codecowboy commented 11 years ago

I'm seeing a weird issue when using one handle and button clicks to 'move' the slider. It only happens on mobile webkit browsers and works fine in all desktop browsers. The slider range is [1,400]. Code here:

[see comments below]

If I manually set the slider range to [0,100], clicking the plus button works as expected but otherwise decreases the slider value by 1 on page load and then stops changing the value thereafter. There is an identical slider on the same page using identical code and that is working fine !?

If I do remote USB debugging on Chrome (Android), the slider values do not change on button tap (the touch events are definitely firing and displayed in the js console). On desktop Chrome, the value increments by 1 as expected.

Any ideas?

codecowboy commented 11 years ago

It seems like this could be something to do with the descale function. I can log the return value there and it is different by +1 on mobile. It also seems that the scale values change to 1,399 in that function if run on a mobile device : I can watch the values using remote debugging over USB.

leongersen commented 11 years ago

Hmm. Do you have a link to the page where this goes wrong, so I can test/compare this?

codecowboy commented 11 years ago

Unfortunately not, its in a dev environment which is not not publicly accessible. Do you have any idea what might be causing it? It seems to be a rounding problem - maybe a big / little Endian issue?

codecowboy commented 11 years ago

Try this http://jsfiddle.net/codecowboy/mLpfu/8/. Click the 'debug on mobile' button - its directly adjacent to the Run button top left. Enter the url into a browser on a smartphone (preferably a webkit browser on iPhone / Android).

Drag the slider to say 265, hit increase. Some values will let you hit increase, some won't. The higher the value, the worse the problem gets.

leongersen commented 11 years ago

I can't 100% verify, but I'm almost sure this is fixed in noUiSlider 3.x.

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.