fix(mobile): reset scroller margin-bottom to 0 after modal/popup closed

This commit is contained in:
Tienson Qin
2025-07-08 02:25:59 +08:00
parent 047dd05400
commit 27bde29598
2 changed files with 9 additions and 11 deletions

View File

@@ -26,7 +26,10 @@
(ion/modal
{:isOpen (boolean open?)
:presenting-element presenting-element
:onDidDismiss (fn [] (mobile-state/set-modal! nil))
:onDidDismiss (fn []
(mobile-state/set-modal! nil)
(state/clear-edit!)
(state/pub-event! [:mobile/keyboard-will-hide]))
:mode "ios" ;; force card modal for android
:expand "block"}

View File

@@ -70,14 +70,6 @@
(set! shui/popup-show! popup-show!)
(set! shui/popup-hide! popup-hide!)
(rum/defc inner-content <
{:will-unmount (fn [state]
(state/clear-edit!)
(init/keyboard-hide)
state)}
[content-fn]
(content-fn))
(rum/defc popup < rum/reactive
[]
(let [{:keys [open? content-fn opts]} (rum/react mobile-state/*popup-data)
@@ -101,7 +93,10 @@
{:isOpen (boolean open?)
:initialBreakpoint initial-breakpoint
:breakpoints breakpoints
:onDidDismiss (fn [] (mobile-state/set-popup! nil))
:onDidDismiss (fn []
(mobile-state/set-popup! nil)
(state/clear-edit!)
(state/pub-event! [:mobile/keyboard-will-hide]))
:expand "block"}
(:modal-props opts))
(ion/content
@@ -111,4 +106,4 @@
[:h2.py-2.opacity-40 title])
(when content-fn
(mobile-ui/classic-app-container-wrap
(inner-content content-fn)))]))))
(content-fn)))]))))