diff --git a/frontend/text-editor/src/editor/TextEditor.js b/frontend/text-editor/src/editor/TextEditor.js index 8408dafa9b..e8b2913fa4 100644 --- a/frontend/text-editor/src/editor/TextEditor.js +++ b/frontend/text-editor/src/editor/TextEditor.js @@ -447,10 +447,7 @@ export class TextEditor extends EventTarget { if ((e.ctrlKey || e.metaKey) && e.key === "a") { e.preventDefault(); this.selectAll(); - return; - } - - if ((e.ctrlKey || e.metaKey) && e.key === "Backspace") { + } else if ((e.ctrlKey || e.metaKey) && e.key === "Backspace") { e.preventDefault(); if (this.#selectionController.isCollapsed) { this.#selectionController.removeWordBackward(); @@ -458,6 +455,14 @@ export class TextEditor extends EventTarget { this.#selectionController.removeSelected(); } this.#notifyLayout(LayoutType.FULL); + } else if (e.shiftKey && e.key === "Enter") { + e.preventDefault(); + if (this.#selectionController.isCollapsed) { + this.#selectionController.insertParagraph(); + } else { + this.#selectionController.replaceWithParagraph(); + } + this.#notifyLayout(LayoutType.FULL); } };