react / react/react-native

FlatList inverted prop ordering of elements causes copy/paste issues

未关闭
#30,383 4 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Component: FlatList Needs: Triage :mag: Never gets stale
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

When the inverted prop is applied to FlatList the elements remain in the order given and are reversed via styling rather than by reversing the order in which they are rendered. This makes it so that, for example, if react-native-web is used, when the list elements are copied, they end up pasting in reverse order.

React Native version:

0.63.3

Steps To Reproduce

  1. Create a list using FlatList
  2. Apply the inverted prop
  3. Note the order of some list items and copy them
  4. Paste them and note that the order is backwards from what was displayed

Expected Results

I would expect that when pasted the list would retain the order that is shown on the screen.

Snack, code example, screenshot, or link to a repository:

https://codesandbox.io/s/cold-wave-grzpj?file=/src/App.js

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 FlatList 的 inverted prop 行为开始,使用链接的 CodeSandbox 重现该问题。比较显示顺序与复制并粘贴后的顺序,包括 react-native-web 的情况。完成标准是复制 inverted 列表时保留其显示的项目顺序。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。