wix / wix/react-native-ui-lib

Slider not setting correct value after rotation

Open
#2,762 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.2k
Forks
748
Avg merge
2d 18h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the linked Expo Snack using react-native-ui-lib 7.8.0 on Android, then inspect the Slider component entry point and its rotation/state handling. Verify the async value changes from 1 to 3 before rotating. Done means rotation preserves the latest value rather than restoring the initial value.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.