Flatlist with initialScrollIndex will cause missing items
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先复现所描述的 Android 案例:一个项目能够容纳在视图中的 React Native FlatList,且其 initialScrollIndex 不为零。比较启用和不启用 disableVirtualization 时的渲染结果;当初始索引之前的项目无需禁用虚拟化即可按正确顺序渲染时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react-native
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 需要澄清
- 新手友好度
- 45/100