mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 07:29:30 +01:00
fix: dont prevent default if action sheet isn't open
This commit is contained in:
@@ -115,9 +115,11 @@ function ActionSheetPresenter(props) {
|
||||
});
|
||||
}, [animation, onClose, contentRef.current]);
|
||||
var handleBackPress = (0, react_1.useCallback)(function (event) {
|
||||
if (!isOpen)
|
||||
return;
|
||||
event.preventDefault();
|
||||
onBeforeClose();
|
||||
}, [onBeforeClose]);
|
||||
}, [isOpen, onBeforeClose]);
|
||||
(0, react_1.useEffect)(function () {
|
||||
// Note: this is a custom event implemented on the React Native
|
||||
// side to handle back button when action sheet is opened.
|
||||
|
||||
@@ -108,10 +108,11 @@ export function ActionSheetPresenter(
|
||||
|
||||
const handleBackPress = useCallback(
|
||||
(event: Event) => {
|
||||
if (!isOpen) return;
|
||||
event.preventDefault();
|
||||
onBeforeClose();
|
||||
},
|
||||
[onBeforeClose]
|
||||
[isOpen, onBeforeClose]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user