diff --git a/src/components/Editor/MarkdownEditor.tsx b/src/components/Editor/MarkdownEditor.tsx index 72c2f121..4f0857a1 100644 --- a/src/components/Editor/MarkdownEditor.tsx +++ b/src/components/Editor/MarkdownEditor.tsx @@ -153,6 +153,12 @@ export function MarkdownEditor({ }); return true; }, + keydown: (evt) => { + if (evt.key === "Enter") { + onSubmit(internalRef.current) + editor.set('') + } + }, blur: () => { if (Platform.isMobile) { view.contentEl.removeClass('is-mobile-editing'); @@ -191,7 +197,7 @@ export function MarkdownEditor({ keymap.of([ { key: 'Enter', - run: makeEnterHandler(false, false), + run: (_: EditorView) => true, shift: makeEnterHandler(false, true), preventDefault: true, },