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
Skaldebane
02/17/2025, 4:40 PM
I think you want to put this as a reply to the existing thread :D
Skaldebane
02/17/2025, 4:41 PM
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).
Skaldebane
02/17/2025, 4:42 PM
You'll wanna pass a custom
interactionSource
and get the
PressInteraction
events from that.
Skaldebane
02/17/2025, 4:50 PM
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
Binod Basnet
02/18/2025, 4:41 AM
Thank you it work. I make a custom interactionSource