From de41cb54888cea02ffe97c351ce76066a0f0d8c3 Mon Sep 17 00:00:00 2001 From: Aitor Moreno Date: Mon, 26 Jan 2026 14:57:40 +0100 Subject: [PATCH] :bug: Fix add/remove fills to text nodes --- frontend/src/app/main/data/workspace/colors.cljs | 4 ++-- .../text-editor/src/editor/controllers/SelectionController.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/data/workspace/colors.cljs b/frontend/src/app/main/data/workspace/colors.cljs index dea003d5ee..a18e967ece 100644 --- a/frontend/src/app/main/data/workspace/colors.cljs +++ b/frontend/src/app/main/data/workspace/colors.cljs @@ -214,8 +214,8 @@ ptk/WatchEvent (watch [_ state _] (let [change-fn - (fn [shape attrs] - (update shape :fills types.fills/prepend attrs)) + (fn [node attrs] + (update node :fills types.fills/prepend attrs)) undo-id (js/Symbol)] (rx/concat diff --git a/frontend/text-editor/src/editor/controllers/SelectionController.js b/frontend/text-editor/src/editor/controllers/SelectionController.js index b2b9822ca3..24cb37d272 100644 --- a/frontend/text-editor/src/editor/controllers/SelectionController.js +++ b/frontend/text-editor/src/editor/controllers/SelectionController.js @@ -238,7 +238,8 @@ export class SelectionController extends EventTarget { #applyStylesFromElementToCurrentStyle(element) { for (let index = 0; index < element.style.length; index++) { const styleName = element.style.item(index); - if (styleName === "--fills") { + // Only merge fill styles from text spans. + if (!isTextSpan(element) && styleName === "--fills") { continue; } let styleValue = element.style.getPropertyValue(styleName);