Skip to content
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

Fix the flex property on iOS not being respected. #1724

Merged
merged 5 commits into from
Dec 5, 2023

Conversation

colinrtwhite
Copy link
Member

Follow up to #1699. This PR fixes Modifier.flex on iOS.

The root cause was scrollEnabled defaulting to true and the YogaLayout's first layout pass would occur before it was set to false by Redwood. That first pass would set each child's frame such that it would affect the later measurement passes. flex relies on flexBasis, which has no effect when the main axis size is undefined (like when measuring a row with scroll enabled).

This PR also includes some minor formatting changes.

@@ -31,10 +31,11 @@ internal class YogaUIView(
var height = Constraint.Wrap

init {
// TODO: Support Scroll Indicators
// TODO: Support scroll indicators.
scrollEnabled = false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the one-line fix.

@colinrtwhite colinrtwhite merged commit 21ded61 into trunk Dec 5, 2023
8 checks passed
@colinrtwhite colinrtwhite deleted the colin/fix_ios_flex branch December 5, 2023 23:14
dnagler added a commit that referenced this pull request Dec 14, 2023
This is a follow-up to PR #1420.
Now that `flex` is working on iOS (as of PR #1724), there's an easy workaround for this issue.
dnagler added a commit that referenced this pull request Dec 14, 2023
This is a follow-up to PR #1420.
Now that `flex` is working on iOS (as of PR #1724), there's an easy workaround for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants