@momo-kits/foundation 0.152.4-beta.2 → 0.152.4-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Application/BottomSheet.tsx +12 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useContext, useEffect, useRef } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
BackHandler,
|
|
3
4
|
Dimensions,
|
|
4
5
|
KeyboardAvoidingView,
|
|
5
6
|
Modal,
|
|
@@ -150,6 +151,17 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
150
151
|
[onDismiss],
|
|
151
152
|
);
|
|
152
153
|
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
const backHandler = BackHandler.addEventListener(
|
|
156
|
+
'hardwareBackPress',
|
|
157
|
+
() => {
|
|
158
|
+
onDismiss();
|
|
159
|
+
return true;
|
|
160
|
+
},
|
|
161
|
+
);
|
|
162
|
+
return () => backHandler.remove();
|
|
163
|
+
}, [barrierDismissible, onDismiss]);
|
|
164
|
+
|
|
153
165
|
/**
|
|
154
166
|
* render header
|
|
155
167
|
*/
|