react-range
react-range copied to clipboard
Warning emitted by isStepDivisible due to floating point value mismatch
I just noticed that if you try and create a Range control which has the following props <Range step={0.1} min={0.1} max={50} ... /> it will emit a The difference of max and min must be divisible by step warning.
This appears to be because (50 - 0.1) / 0.1 equals 498.99999999999994 in JavaScript, but the expression parseInt(res.toString(), 10) actually just returns 498. Most calculators would return 499 for both.
Thank you!
Ah, maybe we should just remove that warning,
+1 remove it
@tajo I fixed this problem in PR above.