Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(slider): non reachable max value and rounding issues
If a max value is not reachable as a multiplier counting from (min + steps * i) it should be adjusted. For example if min=1, max=10 but step=2 then the 10 is never reachable. But this is not fetched and instead a higher value (next reachable step) is rendered instead. Even worse: That wrong value (11 in the example) is selectable although it shouldn't because the max value is still 10. This PR now adjusts a given max value to the last reachable value before the given max value is reached. Given the above example, it now calculates 9 instead of 10. That also corrects the step points of the slider (was misaligned in those cases) While testing i figured out the labels are rendered wrongly when working with float values (the usual JS rounding issue).This is also fixed now. Closes #716
- Loading branch information