fix: show action bar for the first visible node

This commit is contained in:
Tienson Qin
2025-03-02 13:38:49 +08:00
parent 02a3c407fb
commit ca7b3a56be
2 changed files with 2 additions and 2 deletions

View File

@@ -2621,7 +2621,7 @@
(keydown-new-line))))))
(defn- select-first-last
"Select first or last block in viewpoint"
"Select first or last block in viewport"
[direction]
(let [f (case direction :up last :down first)
container (if (some-> js/document.activeElement

View File

@@ -1078,7 +1078,7 @@
(defmethod handle :editor/show-action-bar []
(let [selection (state/get-selection-blocks)
first-visible-block (first selection)]
first-visible-block (some #(when (util/el-visible-in-viewport? % true) %) selection)]
(when first-visible-block
(shui/popup-hide! :selection-action-bar)
(shui/popup-show!