fix(ui): invalid up/down for the page preview editor

pull/11433/head
charlie 2024-07-17 10:53:54 +08:00
parent be7997ed03
commit 32260d13d6
3 changed files with 13 additions and 2 deletions

View File

@ -746,7 +746,7 @@
(rum/set-ref! *timer nil))
(when-not timer1
(rum/set-ref! *timer1
(js/setTimeout #(set-visible! false) 500)))))}
(js/setTimeout #(set-visible! false) 200)))))}
children] children)))
(rum/defcs page-cp < db-mixins/query rum/reactive

View File

@ -241,3 +241,7 @@ html.is-native-ios {
.no-ring {
@apply focus:ring-0 focus:ring-offset-0;
}
.ls-preview-popup {
@apply pl-6;
}

View File

@ -3250,10 +3250,17 @@
(some-> (first (dom/by-class "reveal"))
(dom/has-class? "focused")))
(defn- in-page-preview?
[]
(some-> js/document.activeElement
(.closest ".ls-preview-popup")
(nil?) (not)))
(defn shortcut-up-down [direction]
(fn [e]
(when (and (not (auto-complete?))
(not (in-shui-popup?))
(or (in-page-preview?)
(not (in-shui-popup?)))
(not (slide-focused?))
(not (state/get-timestamp-block)))
(util/stop e)