diff --git a/src/app/hooks/useTextAreaIntent.ts b/src/app/hooks/useTextAreaIntent.ts index 90f1cc37..113316ec 100644 --- a/src/app/hooks/useTextAreaIntent.ts +++ b/src/app/hooks/useTextAreaIntent.ts @@ -36,6 +36,11 @@ export const useTextAreaIntentHandler = ( target.focus(); } if (isKeyHotkey('enter', evt) || isKeyHotkey('shift+enter', evt)) { + evt.preventDefault(); + const cursor = Cursor.fromTextAreaElement(target); + operations.select(intent.addNewLine(cursor)); + } + if (isKeyHotkey('mod+enter', evt)) { evt.preventDefault(); const cursor = Cursor.fromTextAreaElement(target); operations.select(intent.addNextLine(cursor));