🐛 Fix text align shown as left in v3 editor (#10973)

This commit is contained in:
Elena Torró 2026-07-31 11:48:31 +02:00 committed by GitHub
parent f5b17a5c75
commit a2231a8bf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,8 +15,11 @@
(ptk/reify ::v3-update-text-editor-styles
ptk/UpdateEvent
(update [_ state]
(let [merged-styles (merge (txt/get-default-text-attrs)
(fonts/valid-default-font
(get-in state [:workspace-global :default-font]))
new-styles)]
(update-in state [:workspace-wasm-editor-styles id] (fnil merge {}) merged-styles)))))
(if (not= id (get-in state [:workspace-local :edition]))
state
(let [defaults (merge (txt/get-default-text-attrs)
(fonts/valid-default-font
(get-in state [:workspace-global :default-font])))]
(update-in state [:workspace-wasm-editor-styles id]
(fn [current-styles]
(merge defaults current-styles new-styles))))))))