Skip to content

Commit 2121cf7

Browse files
authored
Fix bug, caused by fixing issue #264. (#281)
* Fix rounding error. * Remove unneeded whitespaces.
1 parent c3c92e9 commit 2121cf7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ios/RNCSliderManager.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ static float discreteValue(RNCSlider *sender, float value) {
8484

8585
// Round up when increase, round down when decrease.
8686
double (^_round)(double) = ^(double x) {
87-
if (sender.lastValue > value) {
87+
if (!UIAccessibilityIsVoiceOverRunning()) {
88+
return round(x);
89+
} else if (sender.lastValue > value) {
8890
return floor(x);
8991
} else {
9092
return ceil(x);
9193
}
9294
};
93-
95+
9496
return
9597
MAX(sender.minimumValue,
9698
MIN(sender.maximumValue,

0 commit comments

Comments
 (0)