From 7101b94557e09504fba5966ffc4c6574255c27ea Mon Sep 17 00:00:00 2001 From: AzazelN28 Date: Wed, 27 Nov 2024 11:42:18 +0100 Subject: [PATCH] :bug: Fix selectAll when editor is empty --- .../text-editor/src/editor/controllers/SelectionController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/text-editor/src/editor/controllers/SelectionController.js b/frontend/text-editor/src/editor/controllers/SelectionController.js index 11cca7c1b..0f2aeed07 100644 --- a/frontend/text-editor/src/editor/controllers/SelectionController.js +++ b/frontend/text-editor/src/editor/controllers/SelectionController.js @@ -479,6 +479,9 @@ export class SelectionController extends EventTarget { * Selects all content. */ selectAll() { + if (this.#textEditor.isEmpty) { + return this + } this.#selection.selectAllChildren(this.#textEditor.root); return this; }