Open joeylin opened 1 year ago
@joeylin in case it helps I think I figured this out. You can just do an e.preventDefault()
. My resulting code looks something like this:
<textarea
onKeyDown={(e) => {
if (!e.shiftKey && e.key === 'Enter') {
e.preventDefault();
handleSendMessage();
}
}}
/>
I want to a function like this: when I use shift + enter, I can wrap lines, and the textarea can autoheight, when I use enter key, I can send the message, BUT, when I bind the enter key to textarea(with this plugin), I found enter key was used to wrapping lines default, Does the plugin support this feature? I understand this is a more general scenario.
thanks very much