File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,14 @@ - (void)tapHandler:(UITapGestureRecognizer *)gesture {
7777}
7878
7979static float discreteValue (RNCSlider *sender, float value) {
80+ // Check if thumb should reach the maximum value and put it on the end of track if yes.
81+ // To avoid affecting the thumb when on maximum, the `step >= (value - maximum)` is not checked.
82+ if (sender.step > 0 && value >= sender.maximumValue ) {
83+ return sender.maximumValue ;
84+ }
85+
8086 // If step is set and less than or equal to difference between max and min values,
8187 // pick the closest discrete multiple of step to return.
82-
8388 if (sender.step > 0 && sender.step <= (sender.maximumValue - sender.minimumValue )) {
8489
8590 // Round up when increase, round down when decrease.
You can’t perform that action at this time.
0 commit comments