redwood icon indicating copy to clipboard operation
redwood copied to clipboard

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

Open ean5533 opened this issue 9 months ago • 0 comments

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

ean5533 avatar May 09 '24 18:05 ean5533