-
Notifications
You must be signed in to change notification settings - Fork 145
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest version lost my Flatlist keyboard nav changes, but that's OK I'll mark a followup for that.
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 Co-authored-by: Scott Kyle <[email protected]>
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 Co-authored-by: Scott Kyle <[email protected]>
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 [email protected]
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