From 86b493522cf3adcbe393aa083e8a9e78627dc3ae Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Wed, 22 May 2024 15:12:56 +0200 Subject: [PATCH] Remove unneeded focus hack --- .../ui/workspace/tokens/editable_select.cljs | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/editable_select.cljs b/frontend/src/app/main/ui/workspace/tokens/editable_select.cljs index e929277a9..5333b04cd 100644 --- a/frontend/src/app/main/ui/workspace/tokens/editable_select.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/editable_select.cljs @@ -131,23 +131,6 @@ value (or (d/parse-double value) value)] (set-value value))) - on-node-load - (fn [node] - ;; There is a problem when changing the state in this callback that - ;; produces the dropdown to close in the same event - (when node - (timers/schedule - #(when-let [bounds (when node (dom/get-bounding-rect node))] - (let [{window-height :height} (dom/get-window-size) - {:keys [left top height]} bounds - bottom (when (< (- window-height top) 300) (- window-height top)) - top (when (>= (- window-height top) 300) (+ top height))] - (swap! state* - assoc - :left left - :top top - :bottom bottom)))))) - handle-key-down (mf/use-fn (mf/deps set-value is-open? token) @@ -206,8 +189,7 @@ (mf/set-ref-val! emit-blur? (not is-open?))) - [:div {:class (dm/str class " " (stl/css :editable-select)) - :ref on-node-load} + [:div {:class (dm/str class " " (stl/css :editable-select))} (when-let [{:keys [label value]} token] [:div {:title (str label ": " value) :class (stl/css :token-pill)}