I'm trying to design a modifier that can be used in composable where if you click, it'll automatically log something. e.g. Modifier.logClick = then(Modifier.clickable{ //log })
The problem here is that when users apply to composable that come with onClick
such as Button, my modifier.logClick{}
is then overwritten since internally, onClick()
block is getting assigned as Modifier.clickable
.
Is there a way that I can achieve what I want gracefully? Maybe such as merging two same modifiers or executing sequentially?