You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
how to do command enter and preventing enter from being sent to code editor? #144
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?
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.
Activity
jaywcjlove commentedon Mar 5, 2023
onKeyDown={(event) => { + event.preventDefault(); console.log(">>>>"); }}@TheBuilderJR https://codesandbox.io/embed/https-github-com-uiwjs-react-textarea-code-editor-issues-144-4yvoij?fontsize=14&hidenavigation=1&theme=dark
aleda145 commentedon Mar 5, 2023
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?
jaywcjlove commentedon Mar 8, 2023
react-textarea-code-editor/src/index.tsx
Lines 95 to 99 in dedfb99
onKeyDown={(event) => { + event.preventDefault(); console.log(">>>>"); + return true }}@aleda145 Maybe it can solve your problem
aleda145 commentedon Mar 8, 2023
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
Let me know if there anything you want from me to debug this!
Great package, I still use it! ⭐
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 😄 !
emptycrown commentedon Jun 3, 2023
Running into the same issue -- the event cannot be stopped. Any update here?
Haiqi-Wu commentedon Jun 16, 2023
Same issue.Any update?
jaywcjlove commentedon Jun 16, 2023
Maybe I don't understand what it means, haven't solved the problem yet?
@emptycrown @Haiqi-Wu @aleda145