From fee416d27526d78015e8a8a2d3590449e28e694d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Wed, 12 Aug 2026 15:10:23 +0200 Subject: [PATCH] :bug: Fix crash after changing typography options (v2 and v3) (#11221) --- frontend/src/app/render_wasm/text_editor.cljs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/render_wasm/text_editor.cljs b/frontend/src/app/render_wasm/text_editor.cljs index 9686889dab..b577861f62 100644 --- a/frontend/src/app/render_wasm/text_editor.cljs +++ b/frontend/src/app/render_wasm/text_editor.cljs @@ -345,10 +345,15 @@ :text-direction (sr/untranslate-text-direction (text-editor-get-style-property text-direction-state text-direction-value)) :text-decoration (sr/untranslate-text-decoration (text-editor-get-style-property text-decoration-state text-decoration-value)) :text-transform (sr/untranslate-text-transform (text-editor-get-style-property text-transform-state text-transform-value)) - :line-height (text-editor-get-style-property line-height-state line-height-value) - :letter-spacing (text-editor-get-style-property letter-spacing-state letter-spacing-value) - :font-size (text-editor-get-style-property font-size-state font-size-value) - :font-weight (text-editor-get-style-property font-weight-state font-weight-value) + ;; WASM reports size/weight as numbers, but the rest of Penpot (and the backend schema) expects strings. + :line-height (let [height (text-editor-get-style-property line-height-state line-height-value)] + (if (= height :multiple) height (str height))) + :letter-spacing (let [spacing (text-editor-get-style-property letter-spacing-state letter-spacing-value)] + (if (= spacing :multiple) spacing (str spacing))) + :font-size (let [size (text-editor-get-style-property font-size-state font-size-value)] + (if (= size :multiple) size (str size))) + :font-weight (let [weight (text-editor-get-style-property font-weight-state font-weight-value)] + (if (= weight :multiple) weight (str weight))) :font-style font-style-value :font-family (text-editor-get-style-property font-family-id-state font-id) :font-id (text-editor-get-style-property font-family-id-state font-id)