wix / react-native-ui-lib

UI Components Library for React Native

Home Page:https://wix.github.io/react-native-ui-lib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slider not setting correct value after rotation

damiansolutiem opened this issue · comments

commented

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

  • Components
  • Demo
  • Docs
  • Typings

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

  • tested with "react-native-ui-lib": "7.3.1",
  • Example comparing other slider components

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",

  • React Native version: 0.72.5
  • React Native UI Lib version: 7.8.0

Tested only on Android.

Affected platforms

  • Android
  • iOS
  • Web