Open TheBuilderJR opened 1 year ago
onKeyDown={(event) => {
+ event.preventDefault();
console.log(">>>>");
}}
I was looking at this package, and got the same issue. Linked codesandbox doesn't work for me (using Firefox/Linux (Pop!)) Enter events will still be sent and be added to the CodeEditor. The same onKeyDown eveent on a normal textarea works as expected though. So might be an issue with how onKeyDown is implemented on the CodeEditor?
onKeyDown={(event) => {
+ event.preventDefault();
console.log(">>>>");
+ return true
}}
@aleda145 Maybe it can solve your problem
onKeyDown={(event) => { + event.preventDefault(); console.log(">>>>"); + return true }}
@aleda145 Maybe it can solve your problem
It doesn't work :/, same problem. Also tried adding event.stopPropagation();
, didn't help either. My enter event is still sent to the codeEditor, creating a new line.
The following textArea works as expected for me
<textarea
onKeyDown={(event) => {
event.preventDefault();
}}
></textarea>
Let me know if there anything you want from me to debug this!
Great package, I still use it! :star:
I wanted it to run a SQL query on shift+Enter and not create a new line. But changed to ctrl+space instead, works just as well :smile: !
Running into the same issue -- the event cannot be stopped. Any update here?
Same issue.Any update?
onKeyDown={(event) => { + event.preventDefault(); console.log(">>>>"); + return true }}
@aleda145 Maybe it can solve your problem
Maybe I don't understand what it means, haven't solved the problem yet?
@emptycrown @Haiqi-Wu @aleda145
tried this to no avail