diff --git a/src/index.tsx b/src/index.tsx index 5d6be891..5d6acc84 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -492,7 +492,10 @@ export class Modalize extends React.C } }; - private onHandleOverlay = ({ nativeEvent }: TapGestureHandlerStateChangeEvent): void => { + private onHandleOverlay = ( + { nativeEvent }: TapGestureHandlerStateChangeEvent, + alwaysOpen: boolean, + ): void => { const { onOverlayPress } = this.props; if (nativeEvent.oldState === State.ACTIVE && !this.willCloseModalize) { @@ -500,7 +503,9 @@ export class Modalize extends React.C onOverlayPress(); } - this.close(); + const dest = alwaysOpen ? 'alwaysOpen' : 'default'; + + this.close(dest); } }; @@ -680,7 +685,7 @@ export class Modalize extends React.C closeOnOverlayTap, } = this.props; const { showContent } = this.state; - const pointerEvents = alwaysOpen ? 'box-none' : 'auto'; + const pointerEvents = alwaysOpen && this.modalPosition === 'initial' ? 'box-none' : 'auto'; return ( extends React.C this.onHandleOverlay(resolve, !!alwaysOpen)} >