enhance(ux): popups collision padding for the property editor

pull/11102/head
charlie 2024-02-28 21:33:20 +08:00
parent fafb9bcaf5
commit 308f7cf455
1 changed files with 16 additions and 12 deletions

View File

@ -594,7 +594,8 @@
(route-handler/redirect-to-page! (:block/name property))
(.preventDefault e)))
:on-click (fn [^js e]
(shui/popup-show! (.-target e)
(shui/popup-show!
(.-target e)
(fn [{:keys [id]}]
[:div.p-2
[:h2.text-lg.font-medium.mb-2.p-1 "Configure property"]
@ -604,6 +605,9 @@
:class-schema? class-schema?
:toggle-fn #(shui/popup-hide! id)})])
{:content-props {:class "property-configure-popup-content"
:collisionPadding {:bottom 10 :top 10}
:side "bottom"
:avoidCollisions true
:align "start"}
:as-menu? true}))}
[:div {:style {:padding-left 6}} (:block/original-name property)]])]))