Skip to content

Commit

Permalink
feat: fix enter to submit on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
KGDavidson committed Dec 24, 2024
1 parent feb7330 commit 8cc9b11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Editor/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -191,7 +197,7 @@ export function MarkdownEditor({
keymap.of([
{
key: 'Enter',
run: makeEnterHandler(false, false),
run: (_: EditorView) => true,
shift: makeEnterHandler(false, true),
preventDefault: true,
},
Expand Down

0 comments on commit 8cc9b11

Please sign in to comment.