When I add a .clickable modifier to a Card compone...
# compose
t
When I add a .clickable modifier to a Card component, the ripple doesn't seem to respect the shape. Is there a good way to get past that?
d
the quickest way is to add a
.clip
modifier with the desired shape
t
if i do it before the clickable modifier, then yes the ripple is constrained to the card shape. Unfortunately, it kills the shadow as well. 😞
f
there is a variant of
Card
that accepts a click lambda, did you try that? https://www.composables.com/material3/card
👍 1
t
Thanks @Francesc
I wish the IDE would show the variants of the function when you hover over it.