diff --git a/frontend/src/app/main/ui/workspace/viewport/selection.cljs b/frontend/src/app/main/ui/workspace/viewport/selection.cljs index 9cd2a10c3c..8b304eb2b7 100644 --- a/frontend/src/app/main/ui/workspace/viewport/selection.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/selection.cljs @@ -291,13 +291,18 @@ (if ^boolean scale-text (cur/get-dynamic "scale-ns" rotation) (cur/get-dynamic "resize-ns" rotation))) - on-double-click (fn [_] - (when (= shape-type :text) - (cond - (= position :right) - (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-width))) - (= position :bottom) - (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-height))))))] + + on-double-click + (mf/use-fn + (mf/deps shape-id position shape-type) + (fn [_event] + (when (= shape-type :text) + (cond + (= position :right) + (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-width))) + (= position :bottom) + (st/emit! (dwsh/update-shapes [shape-id] #(assoc % :grow-type :auto-height)))))))] + [:g.resize-handler (when ^boolean show-handler [:circle {:r (/ resize-point-radius zoom)