Slider not setting correct value after rotation

オープン
#2,762 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
react-native, typescript
領域
mobile

調査の方向性

まず、Android 上で react-native-ui-lib 7.8.0 を使用し、リンクされた Expo Snack で問題を再現します。次に、Slider コンポーネントのエントリーポイントと、回転および状態の処理を調査します。回転前に非同期の値が 1 から 3 に変わることを確認します。回転後に初期値へ戻るのではなく、最新の値が維持されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

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
主要言語
TypeScript
スター
7.2k
フォーク
749
平均マージ
29分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wix/react-native-ui-lib のほかの issue

wix/react-native-ui-lib の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。