mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
🐛 Fix text decoration selection on v3 editor (#12255)
This commit is contained in:
parent
c4068a2256
commit
4faac8f746
@ -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`."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user