mirror of
https://github.com/logseq/logseq.git
synced 2026-05-18 18:02:35 +00:00
fix: restore bottom property keyboard navigation
This commit is contained in:
@@ -2709,7 +2709,7 @@
|
||||
(property-component/property-key-cp block property opts)
|
||||
[:div.select-none ":"]]
|
||||
[:div {:class (util/classnames
|
||||
["bottom-property-content ls-block property-value-container"
|
||||
["bottom-property-content property-value-container"
|
||||
{:bottom-property-content-wrap many-node?}])
|
||||
:style {:min-height 20}}
|
||||
(pv/property-value block property opts)
|
||||
@@ -3380,8 +3380,6 @@
|
||||
(when doc-mode?
|
||||
(dom/remove-class! node "hide-inner-bullet"))))
|
||||
(when (non-dragging? e)
|
||||
(when-let [container (gdom/getElement "app-container-wrapper")]
|
||||
(dom/add-class! container "blocks-selection-mode"))
|
||||
(editor-handler/highlight-selection-area! block-id block-dom-node {:append? true})))))
|
||||
|
||||
(defn- block-mouse-leave
|
||||
|
||||
@@ -440,11 +440,9 @@
|
||||
:ls-fold-button-on-right fold-button-on-right?
|
||||
:ls-hl-colored ls-block-hl-colored?}])
|
||||
:on-pointer-up (fn []
|
||||
(when-let [container (gdom/getElement "app-container-wrapper")]
|
||||
(d/remove-class! container "blocks-selection-mode")
|
||||
(when (and (> (count (state/get-selection-blocks)) 1)
|
||||
(not (util/input? js/document.activeElement)))
|
||||
(util/clear-selection!))))}
|
||||
(when (and (> (count (state/get-selection-blocks)) 1)
|
||||
(not (util/input? js/document.activeElement)))
|
||||
(util/clear-selection!)))}
|
||||
|
||||
[:button#skip-to-main
|
||||
{:on-click #(ui/focus-element (ui/main-node))
|
||||
|
||||
@@ -765,9 +765,7 @@ html[data-theme='dark'] {
|
||||
}
|
||||
}
|
||||
|
||||
.blocks-selection-mode .page-title,
|
||||
.blocks-selection-mode .block-content-inner,
|
||||
.blocks-selection-mode .block-body,
|
||||
.blocks-selection-mode .ls-properties-area {
|
||||
@apply select-none;
|
||||
.ls-block.selected,
|
||||
.ls-block.selected * {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@@ -691,8 +691,6 @@
|
||||
;; exit editing mode
|
||||
:else
|
||||
(let [select? (= type :esc)]
|
||||
(when-let [container (gdom/getElement "app-container")]
|
||||
(dom/remove-class! container "blocks-selection-mode"))
|
||||
(p/do!
|
||||
(editor-handler/escape-editing {:select? select?
|
||||
:editing-another-block? editing-another-block?})
|
||||
|
||||
@@ -2154,6 +2154,10 @@
|
||||
[node]
|
||||
(some-> node (.closest ".bottom-properties-row")))
|
||||
|
||||
(defn- bottom-properties-row-in-block
|
||||
[block-node]
|
||||
(some-> block-node (.querySelector ".bottom-properties-row")))
|
||||
|
||||
(defn- focus-trigger
|
||||
[_current-block sibling-block]
|
||||
(if-let [trigger (first (dom/by-class sibling-block "jtrigger"))]
|
||||
@@ -2182,9 +2186,11 @@
|
||||
(assoc :exclude-property? true)))
|
||||
{:block/keys [uuid title]} (state/get-edit-block)
|
||||
sibling-block (or (when (property-value-node? sibling-block)
|
||||
(first (dom/by-class sibling-block "ls-block")))
|
||||
(util/rec-get-node sibling-block "ls-block"))
|
||||
sibling-block)
|
||||
current-bottom-properties-row (bottom-properties-row-in-block current-block)
|
||||
bottom-properties-row (bottom-properties-row-node sibling-block)
|
||||
sibling-bottom-properties-row (bottom-properties-row-in-block sibling-block)
|
||||
property-value-container? (property-value-node? sibling-block)]
|
||||
(if sibling-block
|
||||
(let [sibling-block-id (dom/attr sibling-block "blockid")
|
||||
@@ -2198,6 +2204,20 @@
|
||||
(save-block! repo uuid value))
|
||||
|
||||
(cond
|
||||
(and (= :down direction)
|
||||
input
|
||||
(= active-element input)
|
||||
current-bottom-properties-row)
|
||||
(do
|
||||
(state/clear-edit!)
|
||||
(.focus current-bottom-properties-row))
|
||||
|
||||
(and (= :up direction)
|
||||
sibling-bottom-properties-row)
|
||||
(do
|
||||
(state/clear-edit!)
|
||||
(.focus sibling-bottom-properties-row))
|
||||
|
||||
(and (dom/has-class? sibling-block "block-add-button")
|
||||
(util/rec-get-node current-block "ls-page-title"))
|
||||
(.click sibling-block)
|
||||
@@ -2264,7 +2284,7 @@
|
||||
sibling-block (or (when (and sibling-block (property-value-node? sibling-block))
|
||||
(if (and up? editing-block (gdom/contains sibling-block editing-block))
|
||||
(f sibling-block)
|
||||
(first (dom/by-class sibling-block "ls-block"))))
|
||||
(util/rec-get-node sibling-block "ls-block")))
|
||||
sibling-block)]
|
||||
(when sibling-block
|
||||
(let [content (:block/title block)
|
||||
|
||||
Reference in New Issue
Block a user