https://kotlinlang.org logo
#compose
Title
# compose
d

Dominaezzz

03/05/2021, 12:45 PM
I'm using
Modifier.selectable(...)
and when the composable is clicked, the animation plays and UI is updated, but the composable doesn't stay selected (graphically speaking). Do I have to change the background colour myself?
m

manueldidonna

03/05/2021, 12:58 PM
yes, you need to update the background color in according to your state. The selectable modifier just provides the callbacks and sets the accessibility/debug properties
d

Dominaezzz

03/05/2021, 3:07 PM
It's a little weird that the background colour changes for the animation though.
Like I should also had to do that myself, which is why I was confused.
m

manueldidonna

03/05/2021, 3:08 PM
can you share a code snippet?
This is what it looks like. The list on the left. https://kotlinlang.slack.com/archives/C01D6HTPATV/p1614370237130400
m

manueldidonna

03/05/2021, 3:14 PM
You should use
selectedRoom == room.id
to define the UI. The composable reflects the state and you are the owner of that state