fix: remove waiting timeout for new property value

pull/11049/head
Tienson Qin 2024-02-26 21:11:06 +08:00
parent 3d238f28dd
commit 9121ca710d
1 changed files with 12 additions and 15 deletions

View File

@ -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]