Skip to content

Commit

Permalink
fix: immediate closing drawer of fully opened
Browse files Browse the repository at this point in the history
  • Loading branch information
osdnk authored and satya164 committed Aug 18, 2019
1 parent 2f94281 commit 3f64539
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/drawer/src/views/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export default class DrawerView extends React.PureComponent<Props> {
position: this.position,
time: new Value(0),
finished: new Value(FALSE),
velocity: new Value(0),
};

return block([
Expand All @@ -261,14 +262,11 @@ export default class DrawerView extends React.PureComponent<Props> {
set(frameTime, 0),
set(state.time, 0),
set(state.finished, FALSE),
set(state.velocity, this.velocityX),
set(this.isOpen, isOpen),
startClock(this.clock),
]),
spring(
this.clock,
{ ...state, velocity: this.velocityX },
{ ...SPRING_CONFIG, toValue }
),
spring(this.clock, state, { ...SPRING_CONFIG, toValue }),
cond(state.finished, [
// Reset gesture and velocity from previous gesture
set(this.touchX, 0),
Expand Down

0 comments on commit 3f64539

Please sign in to comment.