fix android hardware back button is not working for nested sheet-screens (#18886)
This commit is contained in:
parent
107f263fb1
commit
f394fcc3d5
|
@ -4,7 +4,6 @@
|
|||
[quo.theme :as theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.gesture :as gesture]
|
||||
[react-native.hooks :as hooks]
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[react-native.safe-area :as safe-area]
|
||||
|
@ -58,7 +57,8 @@
|
|||
(set-animating-true)
|
||||
(reanimated/animate translate-y height 300)
|
||||
(reanimated/animate opacity 0 300)
|
||||
(rf/dispatch [:navigate-back]))
|
||||
(rf/dispatch [:navigate-back])
|
||||
true)
|
||||
reset-open-sheet (fn []
|
||||
(reanimated/animate translate-y 0 300)
|
||||
(reanimated/animate opacity 1 300)
|
||||
|
@ -66,10 +66,11 @@
|
|||
(reset! scroll-enabled? true))]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(rn/hw-back-add-listener close)
|
||||
(reanimated/animate translate-y 0 300)
|
||||
(reanimated/animate opacity 1 300)
|
||||
(set-animating-false 300)))
|
||||
(hooks/use-back-handler close)
|
||||
(set-animating-false 300)
|
||||
#(rn/hw-back-remove-listener close)))
|
||||
[rn/view {:style (style/container insets)}
|
||||
(when-not skip-background?
|
||||
[reanimated/view {:style (style/background opacity)}])
|
||||
|
|
Loading…
Reference in New Issue