From 4faac8f7461c67a4092fda2edef705efe419b1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Torr=C3=B3?= Date: Fri, 9 Oct 2026 15:48:03 +0200 Subject: [PATCH] :bug: Fix text decoration selection on v3 editor (#12255) --- frontend/src/app/render_wasm/text_editor.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/render_wasm/text_editor.cljs b/frontend/src/app/render_wasm/text_editor.cljs index 2f60004eac..d26088820a 100644 --- a/frontend/src/app/render_wasm/text_editor.cljs +++ b/frontend/src/app/render_wasm/text_editor.cljs @@ -771,11 +771,17 @@ (defn- clean-styles "Drop nil-valued attrs (unlike the DOM path, our merge would keep them and fail - the backend schema); a per-span fn is passed through untouched." + the backend schema); a per-span fn is passed through untouched. A nil + `:text-decoration` is the panel's toggle-off, so it becomes \"none\"." [styles] (if (fn? styles) styles - (into {} (remove (comp nil? val)) styles))) + (into {} + (keep (fn [[k v]] + (cond + (some? v) [k v] + (= k :text-decoration) [k "none"]))) + styles))) (defn apply-styles-to-selection "Apply `styles` (attrs map, or a fn per span) to the selected spans; `:with-fills?` also returns `:fills`."