Skip to content

Commit df555a3

Browse files
authored
Merge pull request #7 from react-native-oh-library/dev
[Issue#6] fix JS setValue invalid
2 parents dca9ba0 + bf41a4f commit df555a3

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

package/harmony/slider.har

47 Bytes
Binary file not shown.

package/harmony/slider/oh-package.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rnoh-slider",
3-
"version": "0.0.1",
3+
"version": "4.4.3",
44
"description": "react-native-slider for HarmonyOS",
55
"main": "index.ets",
66
"author": "Huawei",

package/harmony/slider/src/main/ets/Slider.ets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ export struct RNCSlider {
7373
this.unregisterDescriptorChangesListener = this.ctx.descriptorRegistry.subscribeToDescriptorChanges(this.tag,
7474
(newDescriptor) => {
7575
this.descriptor = (newDescriptor as SliderDescriptor)
76+
let value = this.descriptor.props.value;
77+
if (value < this.lowerLimit) {
78+
value = this.lowerLimit;
79+
} else if (value > this.upperLimit) {
80+
value = this.upperLimit;
81+
}
82+
this.SliderValue = value;
7683
}
7784
);
7885
this.SliderValue = this.descriptor.props.value;

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-native-oh-library/slider",
3-
"version": "4.4.3-0.1.2",
3+
"version": "4.4.3-0.1.3",
44
"license": "MIT",
55
"author": "react-native-community",
66
"homepage": "https://github.com/callstack/react-native-slider#readme",

0 commit comments

Comments
 (0)