From 8145eb89d74bbd5242342ec8c49400168e9cd20b Mon Sep 17 00:00:00 2001 From: Aitor Moreno Date: Wed, 29 Jan 2025 23:06:05 +0100 Subject: [PATCH] :bug: Fix styles not being inherited (#5717) --- .../src/editor/controllers/SelectionController.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/text-editor/src/editor/controllers/SelectionController.js b/frontend/text-editor/src/editor/controllers/SelectionController.js index 4f8e49ca9..77cb109a9 100644 --- a/frontend/text-editor/src/editor/controllers/SelectionController.js +++ b/frontend/text-editor/src/editor/controllers/SelectionController.js @@ -358,6 +358,16 @@ export class SelectionController extends EventTarget { detail: this.#currentStyle, }) ); + } else { + const firstInline = this.#textEditor.root?.firstElementChild?.firstElementChild; + if (firstInline) { + this.#updateCurrentStyle(firstInline); + this.dispatchEvent( + new CustomEvent("stylechange", { + detail: this.#currentStyle, + }), + ); + } } }