-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
ScrollView with centerContent={true} renders non-deterministically on iPhone X simulator #24688
Labels
Comments
@zhongwuzw Yeah, that fixed it. Thanks. |
facebook-github-bot
pushed a commit
that referenced
this issue
May 13, 2019
Summary: The bug description can see #24688, we add `contentView` size check before center the content, because in some cases, the contentView's size not yet be calculated, in those cases, we don't adjust the `contentOffset`. cc. cpojer . [iOS] [Fixed] - Fixes ScrollView centerContent not work in some cases Pull Request resolved: #24817 Differential Revision: D15322502 Pulled By: sahrens fbshipit-source-id: e2081f13e9f2e8597a379a9db1607451ea496909
Thanks @zhongwuzw |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
🐛 Bug Report
When a ScrollView has property centerContent={true}, a contained item can sometimes appear not centered. I've only verified this on an iPhone X v12.2 simulator, but I think it happens on devices too. The orange square on the left sometimes is centered properly, and sometimes is centered on the right edge of the green rectangle. Refresh the simulator multiple times and it non-deterministically changes.
To Reproduce
Expected Behavior
The render should not be non-deterministic. It should always be centered. And it should not play differently on iPhone X simulator vs. other simulators.
See video where I refresh the code and see the positioning sometimes changes:
Code Example
Paste this into a fresh "react-native init" project's App.js:
Environment
The text was updated successfully, but these errors were encountered: