From 43b772c18614c9d0e38501f13a05ee09dce07e43 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Tue, 25 Apr 2023 11:36:39 +0300 Subject: [PATCH] Changing the keyboard shortcut for a text editor (#3058) Signed-off-by: Alexander Platov --- packages/text-editor/src/components/TextEditor.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/text-editor/src/components/TextEditor.svelte b/packages/text-editor/src/components/TextEditor.svelte index bed7344167..e8850bffac 100644 --- a/packages/text-editor/src/components/TextEditor.svelte +++ b/packages/text-editor/src/components/TextEditor.svelte @@ -162,7 +162,7 @@ const Handle = Extension.create({ addKeyboardShortcuts () { return { - 'Shift-Enter': () => { + 'Ctrl-Enter': () => { const res = this.editor.commands.splitListItem('listItem') if (!res) { this.editor.commands.first(({ commands }) => [ @@ -174,6 +174,10 @@ } return true }, + 'Shift-Enter': () => { + this.editor.commands.setHardBreak() + return true + }, Enter: () => { submit() return true