ion.rangeSlider icon indicating copy to clipboard operation
ion.rangeSlider copied to clipboard

When using drag_interval the onChange event is called twice on every move to the right.

Open mKlus opened this issue 9 years ago • 6 comments

When using drag_interval the onChange event is called twice on every move to the right.

Her's an example to demonstrate this issue: http://jsfiddle.net/y81j67qh/13/

If you drag the bar to right it always calls the onChange event 2x. First has the old from time, the second has both from and to times updated.

Another issue is that occasionally if you move the bar left slowly (by one step) it doesn't call the onChange on the first change. This is also reproducible in the above example.

Tested in Chrome 46.

mKlus avatar Oct 22 '15 04:10 mKlus

Hello.

  1. Not sure that i manage to reproduce the bug. I think it depends on mouse accuracy and that's all.
  2. Yes, this bug i see.

Nether the less, i will review this callback mechanism and will try to make it more accurate. Tnx.

IonDen avatar Oct 22 '15 09:10 IonDen

Hmm, interesting. I can reproduce p1 (dragging to right always triggers 2 events per mousemove) on 2 different PCs with different mouses (Windows 7, Chrome 46, Logitech MX Performance; Mac OS X, Safari 9, Magic Mouse)

Here are the logs when moving from 300-800 to 330-830.

Data changed: 300, 805 <-- this one should not have been called Data changed: 305, 805 Data changed: 305, 810 <-- this one should not have been called Data changed: 310, 810 Data changed: 310, 815 <-- this one should not have been called Data changed: 315, 815 Data changed: 315, 820 <-- this one should not have been called Data changed: 320, 820 Data changed: 320, 825 <-- this one should not have been called Data changed: 325, 825 Data changed: 325, 830 <-- this one should not have been called Data changed: 330, 830

mKlus avatar Oct 22 '15 09:10 mKlus

Ok maybe. I will check it again more fixedly.

IonDen avatar Oct 22 '15 09:10 IonDen

Hi Denis, is there any update on this issue?

mKlus avatar Apr 18 '16 23:04 mKlus

I was able to fix this issue by changing the targets from "both" to "both_one" in bindEvents here: https://github.com/IonDen/ion.rangeSlider/blob/ef3c9fa8a73715eade068a97fad5ffb367b50ee2/js/ion.rangeSlider.js#L692-L693

milkbadger avatar May 02 '20 21:05 milkbadger

Thank you for finding the issue, I will take a look on it.

IonDen avatar May 05 '20 12:05 IonDen