Skip to content

Commit

Permalink
Revert "feat: added param to close overlay and condition to pointerEv…
Browse files Browse the repository at this point in the history
…ents #151 (#152)"

This reverts commit 92db47b.
  • Loading branch information
jeremybarbet authored Mar 20, 2020
1 parent 92db47b commit 60a5e70
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,20 +492,15 @@ export class Modalize<FlatListItem = any, SectionListItem = any> extends React.C
}
};

private onHandleOverlay = (
{ nativeEvent }: TapGestureHandlerStateChangeEvent,
alwaysOpen: boolean,
): void => {
private onHandleOverlay = ({ nativeEvent }: TapGestureHandlerStateChangeEvent): void => {
const { onOverlayPress } = this.props;

if (nativeEvent.oldState === State.ACTIVE && !this.willCloseModalize) {
if (onOverlayPress) {
onOverlayPress();
}

const dest = alwaysOpen ? 'alwaysOpen' : 'default';

this.close(dest);
this.close();
}
};

Expand Down Expand Up @@ -685,7 +680,7 @@ export class Modalize<FlatListItem = any, SectionListItem = any> extends React.C
closeOnOverlayTap,
} = this.props;
const { showContent } = this.state;
const pointerEvents = alwaysOpen && this.modalPosition === 'initial' ? 'box-none' : 'auto';
const pointerEvents = alwaysOpen ? 'box-none' : 'auto';

return (
<PanGestureHandler
Expand All @@ -703,7 +698,7 @@ export class Modalize<FlatListItem = any, SectionListItem = any> extends React.C
<TapGestureHandler
ref={this.modalOverlayTap}
enabled={panGestureEnabled || closeOnOverlayTap}
onHandlerStateChange={resolve => this.onHandleOverlay(resolve, !!alwaysOpen)}
onHandlerStateChange={this.onHandleOverlay}
>
<Animated.View
style={[s.overlay__background, overlayStyle, this.overlayBackground]}
Expand Down

0 comments on commit 60a5e70

Please sign in to comment.