I have a flow row with items in it that can change...
# compose
c
I have a flow row with items in it that can change size, using
animateContentSize()
causes the item to clip when increasing in size but not when decreasing.. Is this a mistake on my part?
a
I don't think this has anything to do with flow row. You should apply
animateContentSize()
to the content of the chip instead of the chip itself.
1
z
Seeing the same thing with chips in M3, even if it's applied to the contents only.
a
Maybe you are not doing it right. I mean
Copy code
InputChip(
    selected = false,
    onClick = {},
    label = {
        Text(
            text = text,
            modifier = Modifier.animateContentSize()
        )
    }
)
instead of
Copy code
InputChip(
    selected = false,
    onClick = {},
    label = { Text(text = text) },
    modifier = Modifier.animateContentSize()
)
z
In my case I apply it directly to the Text composable
a
Here's the video of the two snippets I posted above.
z
Which version of compose and M3 are you using?
a
Same behavior in latest stable and prerelease. Btw, version shouldn't be important. The same problem and solution also applies to other components with slot API.
z
Can you try including a trailing icon in the chip? Thats the only other thing that comes to mind!
a
Here's the result.
z
Well, good to know that it should work! When time allows Ill try to reduce my chip logic down until it works and see when it starts failing. You can see exactly what my chip looks like below, both leading and trailing icons are wrapped in a Box(centered + 24.dp size).
c
Thanks a lot @Albert Chang will try