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

Android: A Row with 2 children can calculate a size too large for the second child #2017

Open
ean5533 opened this issue May 9, 2024 · 0 comments

Comments

@ean5533
Copy link

ean5533 commented May 9, 2024

Summary

On Android, when two children are nested inside a Row, and the childrens' combined content are greater than the Row's width, the second child's calculated width will exceed the parent Row's bounds. It looks like the second child's width will grow to match the Row's width, despite the first child taking up some of that space.

Works as expected on iOS.

Repro

Row {
  Spacer(30.dp)
  Text("This is a very long piece of text that will wrap the screen")
}

Screenshots

image

Attempted tweaks

  • Adding Modifier.shrink() or Modifier.flex() to the second child makes it work as expected.
  • Adding Modifier.grow() to the second child has no effect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants