react / react/react-native

Flatlist with initialScrollIndex will cause missing items

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

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

Component: FlatList Needs: Attention Needs: Repro
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

If i have the initialScrollIndex set and the list is not bigger than the view (they all fit) then the items before initialScrollIndex will not render , it only works if i set disableVirtualization={true} but the order on how they are rendered doesnt seem right , for example if i have 8 items (and they all fit in the view) and i have set initialScrollIndex to 6th item with disableVirtualization={true} it will render 6 - 7 item first then the 0 to 5, if i dont disable it then it will only render item 6 and 7, if i have more items than they can fit in the view then it seems to work as expected.

Steps to reproduce

Set initialScrollIndex to any item excluding first one on a list that fits to the view.

React Native Version

0.81.5

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
expo  54.0.22
Stacktrace or Logs
nothing to show
MANDATORY Reproducer

/

Screenshots and Videos

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、説明されている Android のケースを再現します。要素がビュー内に収まり、initialScrollIndex が 0 ではない React Native FlatList です。disableVirtualization を有効にした場合と無効にした場合でレンダリングを比較します。initial index より前の要素が、virtualization を無効にせずに正しい順序でレンダリングされれば完了です。

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

評価

技術スタック
react-native
領域
mobile
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
45/100

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

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