wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.31k stars 698 forks source link

Slider not setting correct value after rotation #2762

Open damiansolutiem opened 9 months ago

damiansolutiem commented 9 months ago

Description

The slider component is not setting the correct value after a rotation when a new value comes from an async fetch. When rotated it shows the initial value, what is wrong.

Related to

Steps to reproduce

  1. Add a slider to a component. Set a default value: ex: 1(minimumValue=1, maximumValue= 10).
  2. Add an async function to update the value to "3" after a while (ex: 2 seconds). You can see that the value has been updated in the slider. Ok.
  3. Now, rotate the device. You can see that the slider has value 1 (initial) instead of 3.

Expected behavior

After rotating should keep the last value, not the initial

Actual behavior

The slider keeps the inicial value

More Info

Code snippet

snack : https://snack.expo.dev/@damiantp/rnuilib-slider-rotation

Screenshots/Video

Environment

Expo: v49 "react-native-ui-lib": "7.8.0", "react-native-reanimated": "~3.3.0", "react-native-gesture-handler": "~2.12.0",

Tested only on Android.

Affected platforms

Relax594 commented 6 months ago

+1 same issue on Android with lib ^7.14.0