-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
MM-9548 - Scroll to top when iOS status bar is pressed #3736
Conversation
Related facebook/react-native#21126 |
As a patch, this looks good to me. The diff for the single |
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.
LGTM!
Yep, we could do something like:
patch-package will throw a warning but will still apply the patches:
|
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.
🎉
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.
Tested and looks good to me, thanks @emilioicai!
This issue has been automatically labelled "stale" because it hasn't had recent activity. /cc @jasonblais @hanzei |
Ok, have tested on my iPhone X, iOS 13.3. Working great. My one question is about this caveat in original summary:
@emilioicai is there a way for me to test this? How would a user explicitly have this turned off? |
@adamjclarkson sorry, by user I meant developer, I sent this PR also to React Native’s repo and copied the description. Developers can disable scrolling to top through a specific parameter. |
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.
Works perfectly. Thanks @emilioicai
Thanks @emilioicai! |
Summary
React Native
ScrollViews
(includingFlatLists
) are flipped upside down when the propinverted
is set totrue
. This is the root of many bugs one of them affectingPostList
: tapping on the status bar in iOS should scroll theFlatlist
up to the top.The solution proposed is to detect natively if the ScrollView is inverted, on such case, prevent it from scrolling it to the beginning of the
ScrollView
(as a non-inverted ScrollView would do) and force a scroll to the end of it.I've been careful not to force the scroll if the user explicitly selected not to do it or if it's happening in a nested
ScrollView
, as it's default in iOS.Ticket Link
Fixes mattermost/mattermost#13220
Jira Ticket: https://mattermost.atlassian.net/browse/MM-9548
Checklist
Device Information
This PR was tested on: iPhone XS (iOS 13.1.3), iPhone 8 (iOS 13.1.3)
Screenshots