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 090470f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Editor/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ export function MarkdownEditor({
});
return true;
},
keydown: (evt) => {
if (evt.key === "Enter") {
onSubmit(this.cm)
}
},
blur: () => {
if (Platform.isMobile) {
view.contentEl.removeClass('is-mobile-editing');
Expand Down Expand Up @@ -191,7 +196,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 090470f

Please sign in to comment.