https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
c

Cyril Kym

07/19/2022, 11:05 AM
Hey Eveybody, is there a way to prevent the default behaviour of key events on an BasicTextField? Im currently reacting to a KeyDown Event on
Key.Enter
by using the
onPreviewKeyEvent
Modifier and I do not want the
BasicTextField
to unfocus when Enter is pressed. I was searching for a solution like preventDefault in JS but couldn't find anything so far.
j

james

07/19/2022, 11:19 AM
can you share your code? I'm doing this with
onKeyEvent
and it works as expected.. I just check the key is
Enter
, and if it is I run my own function then return
true
3 Views