-
Notifications
You must be signed in to change notification settings - Fork 24.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
iOS: Fix refreshControl layouting #28236
Conversation
Hi @yogevbd! Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
RNTester.app (iOS): 10715136 bytes |
Edit: nevermind, react-native 0.62 targets iOS 10.0. I didn't know about this change, looks good! My app uses large title (without react-native-navigation) and suffers the same issue. |
I think we dropped support for iOS 9 in January, so that should be possible to land. I will be oncall next week, so I will try to land it today. |
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.
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
The compilation fails with:
stderr: xplat/js/react-native-github/React/Views/ScrollView/RCTScrollView.m:233:23: error: incompatible pointer types assigning to 'UIRefreshControl * _Nullable' from 'UIView *' [-Werror,-Wincompatible-pointer-types]
self.refreshControl = refreshControl;
^ ~~~~~~~~~~~~~~
@shergin The build should pass now. Can you please review? Thanks! |
Base commit: 41fb336 |
Base commit: 41fb336 |
Only the windows tests suite fails. I'm assuming it's flaky since this PR was rebased yesterday and other builds are passing. Could someone please trigger the failing tests suite? 🙏 @shergin |
@shergin Tests are green! 💚 |
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.
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
LGTM! 🔥 |
@shergin @PeteTheHeat Can you guys please try to merge it again? |
Whoop whoop! Great work guys, excited to see this merged as it's now patched in two of our projects 😝 |
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.
@PeteTheHeat has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Thanks a lot for this fix! Looking forward to seeing this merged soon. |
Has this made it into a release yet? |
@simonmitchell @yogevbd tried this out using a patch, and the refresh indicator works great now. I have noticed a couple odd jumps on load sometimes, where the title appears small to start and the content appears under the navbar, but generally much better. However it looks like this has broken |
@chrise86 |
What is the current status on this? Btw @yogevbd how did you manage to apply a transparent background to a large title only with react native navigation? And also remove the border. |
@julian-baumann These options should do with react-native-navigation: {
topBar: {
background: {
color: 'transparent',
noBorder: true
}
}
} |
What is the plan for releasing this? It looks abandoned, doesn't it? |
Well according to this commit details 1b0fb9b it looks like this fix will be part of React Native 0.64 (currently in RC1). |
Summary: Fixes #30912 Reverts #31024 which did not fix the issue This fix was removed in #28236, however it caused bug #7976 to resurface, as reported in #30912 Pull Request resolved: #30978 Test Plan: This code had been present for quite some time before being removed in #28236 ## Changelog [Internal] [fixed] - regression with refresh control Reviewed By: p-sun Differential Revision: D26981600 Pulled By: PeteTheHeat fbshipit-source-id: 2560e7dba1cfd6ed41d98f2c9ff4cd07a0e5fa24
Was this fix released? because I'm still having this issue with the large header and FlatList RefreshControl. |
@yogevbd we are discussing in #31461 how this PR introduces an undesirable visual jump when pulling to refresh on RN list components (scrollview, flatlist, and sectionlist). We are able to reproduce the visual jump on fresh react-native projects with and without navigation headers. After reverting this PR, pulling to refresh is smooth as expected. Do you have any pointers as to why this may be happening, especially since we're able to reproduce without navigation headers? We're really surprised more people haven't mentioned #31461 since it's easily reproducible and it's a very obvious UI issue. Do you think we're safe to rollback this commit locally if we don't use large navigation headers? Or does this PR fix multiple issues with pulling to refresh? If this PR is only intended to fixe this one issue with pull to refresh on large header titles, we may roll this back locally. Thanks. |
@dandre-hound it is safe to rollback this commit if you don't use navigation large headers. Will work on a fix asap. |
Sounds great @yogevbd -- we are happy to help test. Thank you for offering to look into this! |
This reverts commit 1b0fb9b.
Is anybody working on a fix for the bug introduced by this PR? Edit, sorry for the false alarm. It is actually working fine on 0.73 for us. |
Summary
In
react-native-navigation
we allow the usage of native iOS navigationBar largeTitle which cause the title to "jump" when pulling to refresh.We found that the layout calculations of the refreshControl element mess up the system behaviour.
Changelog
[iOS] [Fixed] - Fix refreshControl messes up navigationBar largeTitles
Test Plan
Before the fix:
And after:
How it looks like with react-native init app after the fix: