Skip to content

Commit 3f64539

Browse files
osdnksatya164
authored andcommitted
fix: immediate closing drawer of fully opened
1 parent 2f94281 commit 3f64539

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/drawer/src/views/Drawer.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ export default class DrawerView extends React.PureComponent<Props> {
251251
position: this.position,
252252
time: new Value(0),
253253
finished: new Value(FALSE),
254+
velocity: new Value(0),
254255
};
255256

256257
return block([
@@ -261,14 +262,11 @@ export default class DrawerView extends React.PureComponent<Props> {
261262
set(frameTime, 0),
262263
set(state.time, 0),
263264
set(state.finished, FALSE),
265+
set(state.velocity, this.velocityX),
264266
set(this.isOpen, isOpen),
265267
startClock(this.clock),
266268
]),
267-
spring(
268-
this.clock,
269-
{ ...state, velocity: this.velocityX },
270-
{ ...SPRING_CONFIG, toValue }
271-
),
269+
spring(this.clock, state, { ...SPRING_CONFIG, toValue }),
272270
cond(state.finished, [
273271
// Reset gesture and velocity from previous gesture
274272
set(this.touchX, 0),

0 commit comments

Comments
 (0)