callstack / callstack/react-native-slider

When maximumValue changed value returns to last "clicked" position on Android

Aperta
#542 0 commenti 0 reazioni 1 assegnatario Rivendicata da @draggie Vedi su GitHub
bug report platform: Android
Lingua principale
TypeScript
Stelle
1.4k
Fork
295
Merge medio
5m
PR unite (30g)
1

Descrizione

## Environment
Both Expo and standard react-native

* react-native info output:
```
System:
OS: Windows 10 10.0.22621
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-1280P
Memory: 1.01 GB / 15.71 GB
Binaries:
Node:
version: 20.7.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.19
path: C:\Program Files\nodejs\yarn.CMD
npm:
version: 10.1.0
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.10671973
Visual Studio: Not Found
Languages:
Java:
version: 11.0.2
path: C:\Users\kafka\AppData\Local\jdk-11.0.2\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 10.1.3
wanted: ^10.1.3
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: ^0.72.4
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
```

* are you using the new architecture?

* which version of react & react-native are you using?
* * Localy:
* * * React: 18.2.0
* * * React-Native: 7.4.0
* * * Slider: 4.4.3

* * Expo:
* * * Expo: 47 (when using 48 or 49 I got this error https://github.com/callstack/react-native-slider/issues/527)
* * * Slider: 4.2.4

## Description
When changing maximumValue value returns to last "clicked" value instead of "slided value" when using onValueChange only on Android(iOS and Web works as expected). When using onSlidingComplete it works as expected.

### Sliding
Using onValueChange
1. Slide from 0 to 5
2. Change the max value
After change value is set to 0

Using onSlidingCompleted
1. Slide from 0 to 5
2. Change the max value
After change value is set to 5

### Clicking (only Android and Web, clicking the slider doesn't work on iOS)
Using onValueChange
1. Click to 5 on slider
2. Change the max value
After change value is set to 5

Using onSlidingCompleted
1. Click to 5 on slider
2. Change the max value
After change value is set to 5

Android
![android](https://github.com/callstack/react-native-slider/assets/84576481/83f8270f-95bd-4e54-971a-4e9cccc81172)
iOS
![ios](https://github.com/callstack/react-native-slider/assets/84576481/9475ee5d-4640-422b-ba4c-f7a85d7efc37)
Web
![web](https://github.com/callstack/react-native-slider/assets/84576481/3c05bd20-2f07-4a23-ab28-1d7b030ea873)

## Reproducible Demo
Expo project:
https://snack.expo.dev/@radimkafka/rnc-slider-bug?platform=android

Code can be copied to RN project and it works the same.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.