Skip to content

Commit bfb4ac8

Browse files
authored
fix(slider): iOS fix for when stepSize is set or null
1 parent 281028c commit bfb4ac8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/slider/slider.ios.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,25 @@ export class Slider extends SliderBase {
6969
}
7070
[minValueProperty.setNative](value) {
7171
this.nativeViewProtected.minimumValue = value;
72-
if (this.stepSize !== 0) {
72+
if (this.stepSize) {
7373
// add one to get amount of values and not difference between min and max
7474
const valuesCount = this.maxValue - this.minValue + 1;
75-
this.nativeViewProtected.numberOfDiscreteValues = Math.ceil(valuesCount / value);
75+
this.nativeViewProtected.numberOfDiscreteValues = Math.ceil(valuesCount / this.stepSize);
7676
}
7777
}
7878
[maxValueProperty.setNative](value) {
7979
this.nativeViewProtected.maximumValue = value;
80-
if (this.stepSize !== 0) {
80+
if (this.stepSize) {
8181
// add one to get amount of values and not difference between min and max
8282
const valuesCount = this.maxValue - this.minValue + 1;
83-
this.nativeViewProtected.numberOfDiscreteValues = Math.ceil(valuesCount / value);
83+
this.nativeViewProtected.numberOfDiscreteValues = Math.ceil(valuesCount / this.stepSize);
8484
}
8585
}
8686
[stepSizeProperty.getDefault]() {
8787
return 0;
8888
}
8989
[stepSizeProperty.setNative](value) {
90-
if (value === 0) {
90+
if (!value) {
9191
this.nativeViewProtected.discrete = false;
9292
} else {
9393
this.nativeViewProtected.discrete = true;

0 commit comments

Comments
 (0)