slider icon indicating copy to clipboard operation
slider copied to clipboard

Pushable only works in positive direction with decimal steps

Open Oddsor opened this issue 8 years ago • 4 comments

Not sure if this is a proper bug really, since maybe it shouldn't be possible to use decimals? I'm reporting it in any case:

The following example should demonstrate an issue where if you drag the leftmost handle to the right you can push the other handles, but dragging the rightmost handle to the left does not let you push the others.

http://codepen.io/oddsor/pen/vxOLVO

I'm not sure if this bug is known or if it's something that is easily fixable, so I've just worked around it by ensuring that I use "integers".

Oddsor avatar Feb 26 '17 22:02 Oddsor

  • this line of code will cause something like 0.7 + 0.1 = 0.7999999999999999
  • so there indexOf gets -1, not pushabled

@benjycui

paranoidjk avatar Feb 27 '17 02:02 paranoidjk

I'm using 8.6.1 and also seeing this problem. A simple test is <Range count={3} step={0.1} defaultValue={[20, 40, 60, 80]} />

mvs202 avatar May 03 '18 14:05 mvs202

I'm using 8.6.3 and I'm also seeing this problem

Kadrian avatar Oct 01 '18 13:10 Kadrian

The problem occurs in 9.7.5 too => it disappears in 10.1.1

TracyYXChen avatar Mar 07 '23 03:03 TracyYXChen