react-native-ui-lib
react-native-ui-lib copied to clipboard
Fix range slider initial position, allow thumb positions to be equal
The range slider thumbs exhibited an arbitrary gap when they are moved next to each other. This gap should be zero so that the selected range is n..n (e.g. 10..10) when the thumbs are coincident. The arbitrary gap calculation imposed by the prior implementation results in different behavior based on step and range values.
This solution allows the range endpoints to be equal (no gap). The solution also ensures that the thumbs can always be accessed when thumb positions are the same (100% overlap). Fix initial position of minimum range thumb. The prior implementation was using the user defined range value as a "pixel", "x" value which resulted in the min track having the incorrect stop (filled in to the wrong x position).
There could be a new feature added to maintain a "gap" feature. This is out of scope for this PR.
Can ignore the import re-ordering - done by my lint rules.
Changelog Eliminate the minimum gap between range slider thumbs (minimum gap is now 0). Fix the initial position of the minimum range thumb.