snippets icon indicating copy to clipboard operation
snippets copied to clipboard

Make custom column's children not restricted by column's height

Open hrach opened this issue 2 years ago • 3 comments
trafficstars

This fixes the layout and makes the example fit the description:

The child composables are constrained by the Layout constraints (without the minHeight constraints), and they're placed based on the yPosition of the previous composable.

hrach avatar Jun 07 '23 12:06 hrach

@hrach thanks for your PR. Could you please provide more info why you think this is needed? Since it's a simple code snippet, we just want the incoming parent constraints to be used as they are in this case

simona-anomis avatar Jun 13 '23 12:06 simona-anomis

@simona-anomis

we just want the incoming parent constraints to be used as they are in this case

For containers, it is hardly wanted to impose incoming constraints on its children. "normal" Column/Row does not allow this at all, Box allows this after setting propagateMinConstraints=true.

What's more, as cited, the text mentions it ("without the minHeight constraints") but doesn't do it, which may mislead the reader even more.

hrach avatar Jun 13 '23 12:06 hrach

@hrach ah I see. My interpretation was that, since it's a simple code snippet, "without the minHeight constraints" means we won't change any constraints, not even minHeight. But your interpretation is opposite, more matching the expected Column behaviour.

In that case, could you please move this to line 158 (you've made a change in the wrong snippet) and leave a comment above, explaining why you're overriding the child items constraints? Thanks 😊

simona-anomis avatar Jun 13 '23 13:06 simona-anomis