Support inverted ScrollView on macOS#1264
Conversation
|
The goal of this PR is that instead of doing a scale transformation on the scrollview contents like Flatlist on iOS does, we're instead taking advantage of macOS's flipped coordinate space? |
|
@Saadnajmi > This is an internal change we have used at Meta because
Hence we added 'native' support for inverted views |
1ed7255 to
22e7794
Compare
There was a problem hiding this comment.
When I test the Flatlist example page (packages/rn-tester/js/examples/FlatList/FlatList-basic.js) with this change, all the elements seem inverted?
Interestingly enough, if I make an edit in a file (causing fast refresh), it fixes itself.
Screen.Recording.2022-07-22.at.11.20.46.AM.mov
|
Good catch! And easy to repro. It fixes 'itself' when you edit FlatList-basic.js because fast refresh will reset the 'inverted' flag. I'll look for a proper fix! |
22e7794 to
9a6231a
Compare
|
That latest version should both work with ScrollView and FlatList. Would be great to get some additional verification as well |
9a6231a to
a0b0de8
Compare
|
The latest iteration does indeed pass the "Basic" Flatlist test page, but seems to have no effect on both the Flatlist and SectionList "Inverted" test pages :/ Screen.Recording.2022-07-25.at.4.26.48.PM.mov |
|
This PR looks like one we'd like to merge, but needs a bit more love for all of the test pages / use cases of Flatlist. Thanks for this fix! |
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
|
don't close, bot? |
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
|
Don't close? |
a0b0de8 to
2856e4c
Compare
cc8087c to
ea07b6f
Compare
270ba00 to
8a052a5
Compare
Saadnajmi
left a comment
There was a problem hiding this comment.
Switched back to request changes for last comment, it would be bad to break iOS 😅
Allow to render a scrollView's content in inverted order which is especially helpful in messaging applications. We can't rely on -1 scale hacks on macOS because of inverse issues with trackpad/scrollwheel, dragging scrollbars, tracking hovers, etc. Hence we added 'native' support for inverted views
8a052a5 to
156cdd7
Compare
|
I have remove those changes |
Saadnajmi
left a comment
There was a problem hiding this comment.
Latest version lost my Flatlist keyboard nav changes, but that's OK I'll mark a followup for that.
Please select one of the following
Summary
Allow to render a scrollView's content in inverted order which is especially helpful in messaging applications.
Co-authored-by: Scott Kyle skyle@fb.com
Changelog
[macOS] [Added] - Support inverted ScrollView on macOS
Test Plan
Added RNTester example
Screen.Recording.2022-07-20.at.4.30.22.PM.mov
Default, non-inverted example
Screen.Recording.2022-07-20.at.4.39.55.PM.mov