Is there a reason `Modifier.onClick` is still expe...
# compose-desktop
m
Is there a reason
Modifier.onClick
is still experimental? It's one of the most basic modifiers I use everywhere.
s
I think
Modifier.clickable
is the stable interface unless you're doing something that specifically needs
Modifier.onClick
.
👍🏻 1
m
Modifier.clickable
does the extra Material Design ripple / other indication, that I don't need in a desktop app. I just want a click handler.
s
I don't know your use case. You can disable the indication if that's the issue. I don't know if you want the other stuff like hover, focus, etc
You could also make your own extension and call
Modifier.onClick
from there. If the API changes, you only have one place to update.
m
You can disable the indication if that's the issue.
I assumes that's what
onClick
is for - a
clickable
for when you don't want indications.
s
Consider using clickable if it's necessary to handle only primary clicks. Unlike clickable, onClick doesn't add Modifier. indication, Modifier. hoverable, Modifier. focusable, click by Enter key, etc. If necessary, one has to add those manually when using onClick.
I think
onClick
is for the cases where you need to handle other click types.
d
Dear all, unfortunately the
Modifier.clickable
is not triggered but
Modifier.OnFocus
is working.