Zoltan Demant
09/26/2023, 6:11 AMModifier factory functions must use the receiver Modifier instance
for the snippet below. Yet both clickable/pointerInput does this then modifier
under the hood. Bug, or am I missing something?
private fun Modifier.interactions(
onClick: (() -> Unit)?,
): Modifier {
return when {
onClick != null -> clickable(
onClick = onClick,
)
else -> pointerInput(Unit) {}
}
}
ephemient
09/26/2023, 7:55 AMthis then
is using the receiver Modifier
, your code is not (directly)ephemient
09/26/2023, 7:56 AMthis then when {
onClick != null -> Modifier.clickable(...)
...
and make it look more normal