0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 17:00:36 -05:00

🐛 Fix export in viewer

This commit is contained in:
Alejandro Alonso 2024-01-24 08:40:34 +01:00
parent c7ac3b0163
commit 2091fbca7c

View file

@ -86,27 +86,26 @@
(mf/use-callback
(mf/deps shapes)
(fn [index event]
(let [target (dom/get-target event)
value (dom/get-value target)
value (d/parse-double value)]
(swap! exports assoc-in [index :scale] value))))
(let [scale (d/parse-double event)]
(swap! exports assoc-in [index :scale] scale))))
on-suffix-change
(mf/use-callback
(mf/deps shapes)
(fn [index event]
(let [target (dom/get-target event)
value (dom/get-value target)]
(fn [event]
(let [value (dom/get-target-val event)
index (-> (dom/get-current-target event)
(dom/get-data "value")
(d/parse-integer))]
(swap! exports assoc-in [index :suffix] value))))
on-type-change
(mf/use-callback
(mf/deps shapes)
(fn [index event]
(let [target (dom/get-target event)
value (dom/get-value target)
value (keyword value)]
(swap! exports assoc-in [index :type] value))))
(let [type (keyword event)]
(swap! exports assoc-in [index :type] type))))
manage-key-down
(mf/use-callback
(fn [event]
@ -177,7 +176,7 @@
:type "text"
:value (:suffix export)
:placeholder (tr "workspace.options.export.suffix")
:data-value index
:data-value (str index)
:on-change on-suffix-change
:on-key-down manage-key-down}]]]