🐛 Fix focus the first property value when creating a variant (#7329)

This commit is contained in:
Luis de Dios
2025-09-16 23:25:18 +02:00
committed by GitHub
parent 2eed7444b7
commit 4fe6cfc57a

View File

@@ -277,11 +277,11 @@
(dwu/commit-undo-transaction undo-id))))))
(defn- focus-property
[shape-id prop-num]
[variant-id]
(ptk/reify ::focus-property
ptk/EffectEvent
(effect [_ _ _]
(dom/focus! (dom/get-element (str "variant-prop-" shape-id prop-num))))))
(dom/focus! (dom/get-element (str "variant-prop-" variant-id "-0"))))))
(defn- resposition-and-resize-variant
"Resize the variant container, and move the shape (that is a variant) to the right"
@@ -347,7 +347,7 @@
(if multiselect?
(dws/shift-select-shapes new-shape-id)
(dws/select-shape new-shape-id)))
(->> (rx/of (focus-property new-shape-id prop-num))
(->> (rx/of (focus-property (:id variant-container)))
(rx/delay 250))))))))
(defn transform-in-variant