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

Fix copy and paste order bug created by inverted FlatList #2345

Closed
wants to merge 10 commits into from

Conversation

AndrewGable
Copy link

This original PR was created by @azimgd here but never taken out of draft. In addition it contains additional fixes for Safari as mentioned here: Expensify#3

Expected Result:

  • When copying text in <FlatList inverted={true} /> that when you highlight lines of text, including across multiple messages, that the text is highlighted in order from top to bottom or bottom to top.
  • When pasting text that has been copied from Flatlist, that it shows up in the correct order.

Actual Result:

  • Copying is sporadic and 'jumps around' when you highlight text over multiple messages.
  • Pasting - When pasting copied text from multiple e.cash messages, it's out of order
Highlighting glitch Copy order

This has been reviewed and tested by multiple developers. Some references are:

Implementation

I have removed flatlist inversion (by inverted=true prop) which used [transform: translate] css hack and instead adding flatlist array items in reverse order [unshift instead of push]; It also reverses ScrollView event response received from browser [e.nativeEvent.configOffset *= -1];

Sidenote

I was not able to fix this issue by applying this code directly in React Native repo. The reason is that RN column-reverse won't anchor scroll position to the bottom on Mobile device as it does on Web
facebook/yoga#866 (comment)

@AndrewGable
Copy link
Author

Looks like this branch is too out of date, I will update it in a new PR.

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

Successfully merging this pull request may close these issues.

5 participants