Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
puneetlath opened this issue Nov 11, 2020 · 3 comments
Closed

Comments

@puneetlath
Copy link

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.

@necolas
Copy link
Owner

necolas commented Nov 11, 2020

VirtualizedList / FlatList comes directly from React Native, so you should raise this issue in that repo. But I don't know that there is any practical alternative to the existing approach to inversion, where the HTML order is preserved. There are also some flexbox issues in React Native that might be involved - facebook/react-native#23632 (comment)

@necolas necolas closed this as completed Nov 11, 2020
@mallenexpensify
Copy link

If anyone is able to fix this, we're willing to compensate. Issue posted Expensify/App#1341

@mallenexpensify
Copy link

We're still looking for help to "Fix Inverted prop on the FlatList component with a RN Patch". The current link is Expensify/App#3381 job amount is $8000. Any help/tips are greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants