Action using Textarea

I am using TextArea in this way: I save the series of letters entered using "on input". Additionally, I have a button that calls a function to do something with the saved text. I would prefer to call the function when a user hits the return key within the TextArea when they have entered their full text. Is that possible?

Yes - you can capture an ENTER key with the Frame keydown:

const t = new TextArea().center()

F.on("keydown", e=>{
    if (e.key=="Enter" && t.focus) zog("do submit")
})

Yes, that did it. Thanks.

1 Like