react / react/react-native

FlatList inverted prop ordering of elements causes copy/paste issues

Open
#30,383 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Component: FlatList Needs: Triage :mag: Never gets stale
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

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

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 with the FlatList inverted prop behavior and reproduce the issue using the linked CodeSandbox. Compare the displayed order with the copied and pasted order, including the react-native-web case. Done means inverted lists preserve their displayed item order when copied.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.