diff --git a/src/main/frontend/components/whiteboard.css b/src/main/frontend/components/whiteboard.css index 29a4e29f27..4643527bdb 100644 --- a/src/main/frontend/components/whiteboard.css +++ b/src/main/frontend/components/whiteboard.css @@ -22,7 +22,7 @@ h1.title.whiteboard-dashboard-title { height: 300px; .dashboard-card-checkbox { - @apply flex items-center justify-center rounded; + @apply flex items-center justify-center rounded flex-shrink-0; border: 2px solid var(--ls-border-color); visibility: hidden; width: 24px; diff --git a/src/main/frontend/ui.cljs b/src/main/frontend/ui.cljs index 9260774a5f..f440aa2fb9 100644 --- a/src/main/frontend/ui.cljs +++ b/src/main/frontend/ui.cljs @@ -1010,15 +1010,15 @@ (rum/defc portal ([children] - (portal children #(js/document.createElement "div"))) - ([children append-to] + (portal children #(js/document.createElement "div") false)) + ([children attach-to prepend?] (let [[portal-anchor set-portal-anchor] (rum/use-state nil)] (rum/use-effect! (fn [] - (let [div (or (if (fn? append-to) (append-to) append-to) - (js/document.createElement "div"))] + (let [div (js/document.createElement "div") + attached (or (if (fn? attach-to) (attach-to) attach-to) js/document.body)] (.setAttribute div "data-logseq-portal" (str (d/squuid))) - (.append js/document.body div) + (if prepend? (.prepend attached div) (.append attached div)) (set-portal-anchor div) #(.remove div))) [])