From bda977202ac641161540649cbac8310ab84f51ac Mon Sep 17 00:00:00 2001 From: Aitor Moreno Date: Thu, 28 May 2026 11:52:46 +0200 Subject: [PATCH] :bug: Fix shift enter not working on text editor v2 --- frontend/text-editor/src/editor/TextEditor.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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); } };