The order of modifier functions matters because each function transforms the Modifier returned by the previous one. For example, if you apply .clickable {} before .clip(), the click ripple will not be constrained to the clipped shape.
To ensure the ripple or background respects the shape, apply clipping and background modifiers before the clickable modifier.
This rule is enforced by compose:modifier-clickable-order.
// ✅ Correct: Clip and background are applied first, then clickability
@Composable
fun MyCard(modifier: Modifier = Modifier) {
Column(
modifier
.clip(shape = RoundedCornerShape(8.dp))
.background(color = backgroundColor, shape = RoundedCornerShape(8.dp))
.clickable { /* TODO */ }
) {
// ...
}
}