Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: navigation drawer sometimes not closing when pressed outside
Browse files Browse the repository at this point in the history
  • Loading branch information
osdnk committed Oct 21, 2019
1 parent 2680b46 commit 0d8cdc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions packages/drawer/src/views/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,14 @@ export default class DrawerView extends React.PureComponent<Props> {
x: this.touchX,
translationX: this.gestureX,
velocityX: this.velocityX,
state: this.gestureState,
},
},
]);

private handleGestureStateChange = event([
{
nativeEvent: {
state: (s: Animated.Value<number>) => set(this.gestureState, s),
},
},
]);
Expand Down Expand Up @@ -519,7 +526,7 @@ export default class DrawerView extends React.PureComponent<Props> {
activeOffsetX={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}
failOffsetY={[-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM]}
onGestureEvent={this.handleGestureEvent}
onHandlerStateChange={this.handleGestureEvent}
onHandlerStateChange={this.handleGestureStateChange}
hitSlop={hitSlop}
enabled={!locked}
{...gestureHandlerProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class MaterialBottomTabView extends React.PureComponent<Props> {
target: state.key,
})
}
renderScene={({ route }) => descriptors[route.key].render()}
renderScene={({ route }: Scene) => descriptors[route.key].render()}
renderIcon={this.renderIcon}
getLabelText={this.getLabelText}
getColor={this.getColor}
Expand Down

0 comments on commit 0d8cdc8

Please sign in to comment.