I am setting a Text as clickable. However a grey b...
# compose
d
I am setting a Text as clickable. However a grey background shows up on mouse over. How to remove such effect?
Copy code
Text(
  modifier = Modifier.clickable { eventFunction() },
  text = "my text",
)
n
try to use
Copy code
Modifier.clickable(
    enabled = true,
    interactionSource = remember {      MutableInteractionSource() },
    indication = null,
    onClick = eventFunction
)
👍 1
setting "indication" to null should disable the grey background
d
@Nikolas Guillen Leon thanks, it works! I had tried earlier to add
indication = null
, without the
interactionSource
, and it didn't work. I can see it works only if you add the interaction source. Thanks!
👍 1
m
That's because there's two clickable functions and the one with indication has the interactionSource as a required parameter 🫠
thank you color 1
1
d
Thanks @mohamed rejeb for the insight!