From 7c627db203acfd072dd98249bca338df9ac9724d Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 5 Sep 2025 14:52:59 +0800 Subject: [PATCH] fix: popup can't be scrolled --- src/main/mobile/components/app.css | 2 +- src/main/mobile/components/popup.cljs | 39 ++++++++++++++++----------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/main/mobile/components/app.css b/src/main/mobile/components/app.css index aa84976e0b..4ed3fc50d8 100644 --- a/src/main/mobile/components/app.css +++ b/src/main/mobile/components/app.css @@ -157,6 +157,7 @@ ul { .app-silk-scroll-content { @apply min-h-screen; + padding-bottom: 200px; } } @@ -335,7 +336,6 @@ ul { overflow: hidden; overflow: clip; position: relative; - padding-bottom: 200px; } html[data-silk-native-page-scroll-replaced=false] .app-silk-index-scroll-view { diff --git a/src/main/mobile/components/popup.cljs b/src/main/mobile/components/popup.cljs index 9bb5b47e70..dd873a5bf9 100644 --- a/src/main/mobile/components/popup.cljs +++ b/src/main/mobile/components/popup.cljs @@ -101,19 +101,26 @@ (silkhq/bottom-sheet-content {:class "flex flex-col items-center p-2"} (silkhq/bottom-sheet-handle) - (let [title (or (:title opts) (when (string? content-fn) content-fn)) - content (if (fn? content-fn) - [:div {:style (cond-> {} - (or (nil? default-height) (number? default-height)) - (assoc :min-height (or default-height 300)))} - (content-fn)] - (if-let [buttons (and action-sheet? (:buttons opts))] - [:div.-mx-2 - (for [{:keys [role text]} buttons] - (ui/menu-link {:on-click #(some-> (:on-action opts) (apply [{:role role}])) - :data-role role} - [:span.text-lg.flex.items-center text]))] - (when-not (string? content-fn) content-fn)))] - [:div.w-full.app-silk-popup-content-inner.p-2 - (when title [:h2.py-2.opacity-40 title]) - content]))))))) + (silkhq/scroll + {:as-child true} + (silkhq/scroll-view + {:class "app-silk-scroll-view overflow-y-scroll" + :scrollGestureTrap {:yEnd true} + :style {:min-height (if (number? default-height) + default-height + 400) + :max-height "80vh"}} + (silkhq/scroll-content + (let [title (or (:title opts) (when (string? content-fn) content-fn)) + content (if (fn? content-fn) + (content-fn) + (if-let [buttons (and action-sheet? (:buttons opts))] + [:div.-mx-2 + (for [{:keys [role text]} buttons] + (ui/menu-link {:on-click #(some-> (:on-action opts) (apply [{:role role}])) + :data-role role} + [:span.text-lg.flex.items-center text]))] + (when-not (string? content-fn) content-fn)))] + [:div.w-full.app-silk-popup-content-inner.p-2 + (when title [:h2.py-2.opacity-40 title]) + content]))))))))))