From 9121ca710d03b7c53251ae77b8dd49a91fea8fb3 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 26 Feb 2024 21:11:06 +0800 Subject: [PATCH] fix: remove waiting timeout for new property value --- src/main/frontend/components/property.cljs | 27 ++++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 484a3d6fa..f534f6689 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -356,25 +356,22 @@ (let [*el-ref (rum/use-ref nil)] (rum/use-effect! - (fn [] - (let [content-fn - (fn [{:keys [id]}] - (property-config entity property - (merge opts {:toggle-fn #(shui/popup-hide! id) - :block entity - :add-new-property? true})))] - (js/setTimeout - (fn [] - (when-let [^js target (rum/deref *el-ref)] - (shui/popup-show! target content-fn - {:content-props {:onOpenAutoFocus #(.preventDefault %) :class "w-auto"}}))) - 100))) - []) + (fn [] + (let [content-fn + (fn [{:keys [id]}] + (property-config entity property + (merge opts {:toggle-fn #(shui/popup-hide! id) + :block entity + :add-new-property? true})))] + (when-let [^js target (rum/deref *el-ref)] + (shui/popup-show! target content-fn + {:content-props {:onOpenAutoFocus #(.preventDefault %) :class "w-auto"}})))) + []) [:div.is-new-editing-property-input {:ref *el-ref} (pv/property-value entity property property-value - (assoc opts :editing? true))])) + (assoc opts :editing? true))])) (rum/defc property-select [exclude-properties on-chosen input-opts]