Skip to content

Copy and Pasting text comes out backwards when using FlatList inverted #1807

@puneetlath

Description

@puneetlath

The problem
When using the inverted prop with FlatList text is pasted in backwards order. For example if the list (after inversion) is:

  • 1
  • 2
  • 3
  • 4

Copy and pasting it will result in:

  • 4
  • 3
  • 2
  • 1

How to reproduce
Simplified test case: https://codesandbox.io/s/cold-wave-grzpj?file=/src/App.js

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 behavior
I would expect that when pasted the list would retain the order that is shown on the screen.

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.13.18
  • React (version): 16.14.0
  • Browser: Chrome, Safari, Firefox

Additional context
The problem seems to have to do with the fact that when the inverted prop is applied, the html elements are still in the original order and the inversion is done via css flex-direction: column-reversed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions