I want to show some toast when I click in textfiel...
# compose
b
I want to show some toast when I click in textfield. I use modifier.clickable but it also won't work. I also try Box to wrap textfield and do modifier.clickable but this also don't work
🧵 2
s
I think you want to put this as a reply to the existing thread :D
Anyhoo,
Modifier.clickable
isn't the right solution here; as it'll take all click inputs away from the text field (i.e. you won't be able to move the cursor or click on text).
You'll wanna pass a custom
interactionSource
and get the
PressInteraction
events from that.
Mmm, trying it out, it seems to only emit a
PressInteraction
when there's no text in the text field. Not sure if that's a bug or intended behavior, but it's definitely surprising.
b
Thank you it work. I make a custom interactionSource
🙌 1