diff --git a/src/native_components/RNIModalSheetVIew/RNIModalSheetView.tsx b/src/native_components/RNIModalSheetVIew/RNIModalSheetView.tsx index da5c361e..1c688cad 100644 --- a/src/native_components/RNIModalSheetVIew/RNIModalSheetView.tsx +++ b/src/native_components/RNIModalSheetVIew/RNIModalSheetView.tsx @@ -111,6 +111,24 @@ export const RNIModalSheetView = React.forwardRef< event.nativeEvent ); }} + onModalWillDismiss={(event) => { + props.onModalWillDismiss?.(event); + event.stopPropagation(); + + modalEventEmitterRef.current!.emit( + 'onModalWillDismiss', + event.nativeEvent + ); + }} + onModalDidDismiss={(event) => { + props.onModalDidDismiss?.(event); + event.stopPropagation(); + + modalEventEmitterRef.current!.emit( + 'onModalDidDismiss', + event.nativeEvent + ); + }} onModalWillShow={(event) => { props.onModalWillShow?.(event); event.stopPropagation(); diff --git a/src/types/ModalSheetViewEventEmitter.ts b/src/types/ModalSheetViewEventEmitter.ts index 2c6a7776..b6708fc9 100644 --- a/src/types/ModalSheetViewEventEmitter.ts +++ b/src/types/ModalSheetViewEventEmitter.ts @@ -1,7 +1,7 @@ import type { TSEventEmitter } from '@dominicstop/ts-event-emitter'; import type { RemapObject } from 'react-native-ios-utilities'; -import type { OnModalDidHideEventPayload, OnModalDidPresentEventPayload, OnModalDidShowEventPayload, OnModalWillHideEventPayload, OnModalWillPresentEventPayload, OnModalWillShowEventPayload } from './CommonModalEvents'; +import type { OnModalDidDidDismissEventPayload, OnModalDidHideEventPayload, OnModalDidPresentEventPayload, OnModalDidShowEventPayload, OnModalWillDismissEventPayload, OnModalWillHideEventPayload, OnModalWillPresentEventPayload, OnModalWillShowEventPayload } from './CommonModalEvents'; import type { OnModalSheetStateDidChangeEventPayload, OnModalSheetStateWillChangeEventPayload } from '../native_components/RNIModalSheetVIew'; @@ -9,6 +9,8 @@ export enum ModalSheetViewEvents { // common modal presentation events onModalWillPresent = "onModalWillPresent", onModalDidPresent = "onModalDidPresent", + onModalWillDismiss = "onModalWillDismiss", + onModalDidDismiss = "onModalDidDismiss", onModalWillShow = "onModalWillShow", onModalDidShow = "onModalDidShow", onModalWillHide = "onModalWillHide", @@ -24,6 +26,8 @@ export type ModalSheetViewEventKeys = keyof typeof ModalSheetViewEvents; export type ModalSheetViewEventEmitterMap = RemapObject