fix(mobile): clicking icon and properties shouldn't redirect page

This commit is contained in:
Tienson Qin
2025-12-16 15:20:55 +08:00
parent 135878a78f
commit 9cfb7f0b2e
3 changed files with 27 additions and 23 deletions

View File

@@ -2439,11 +2439,15 @@
"Hide query"
"Set query")]))]
[:div
{:class (if query?
"inline-flex"
"w-full inline")
:on-mouse-over #(set-hover? true)
:on-mouse-out #(set-hover? false)}
(merge
{:class (if query?
"inline-flex"
"w-full inline")
:on-mouse-over #(set-hover? true)
:on-mouse-out #(set-hover? false)}
(when-let [on-title-click (:on-title-click config)]
(when (fn? on-title-click)
{:on-click on-title-click})))
(cond
(and query? (and blank? (or advanced-query? show-query?)))
[:span.opacity-75.hover:opacity-100 "Untitled query"]

View File

@@ -458,21 +458,7 @@
:on-pointer-down (fn [e]
(when (util/right-click? e)
(state/set-state! :page-title/context {:page (:block/title page)
:page-entity page})))
:on-click (fn [e]
(when-not (some-> e (.-target) (.closest ".ls-properties-area"))
(when-not (= (.-nodeName (.-target e)) "INPUT")
(.preventDefault e)
(cond
(gobj/get e "shiftKey")
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id page)
:page)
(and (util/mobile?) journals?)
(route-handler/redirect-to-page! (:block/uuid page))
:else
nil))))}
:page-entity page})))}
[:div.w-full.relative
(component-block/block-container
@@ -488,7 +474,18 @@
:hide-children? true
:container-id container-id
:show-tag-and-property-classes? true
:journal-page? (ldb/journal? page)}
:journal-page? (ldb/journal? page)
:on-title-click (fn [e]
(cond
(gobj/get e "shiftKey")
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id page)
:page)
(and (util/mobile?) journals?)
(route-handler/redirect-to-page! (:block/uuid page))
:else
nil))}
page)]]))
(defn- page-mouse-over

View File

@@ -30,9 +30,12 @@
(.present
plugin
(clj->js
(let [height (popup-min-height (:default-height opts))]
(let [height (popup-min-height (:default-height opts))
height' (if (contains? #{:ls-icon-picker} id)
760
height)]
(cond-> {:allowFullHeight (not= (:type opts) :action-sheet)}
(int? height) (assoc :defaultHeight height)))))))))
(int? height') (assoc :defaultHeight height')))))))))
(defn- dismiss-native-sheet!
[]