@@ -412,18 +412,25 @@ export default class Card extends React.Component<Props> {
412
412
cond (
413
413
eq ( this . props . current , isVisible ) ,
414
414
call (
415
- [ this . didMovementHappen , this . isVisible ] ,
416
- ( [ didMovementHappen ] : ReadonlyArray < Binary > ) => {
415
+ [ this . didMovementHappen , isVisible ] ,
416
+ ( [ didMovementHappen , isVisibleVal ] : ReadonlyArray <
417
+ Binary | number
418
+ > ) => {
417
419
if ( didMovementHappen ) {
418
420
// if we go back to the same position,
419
421
// let's pretend that whole animation happen
420
422
// for making the logic consistent
421
423
// It's especially vital for having inputs properly focused.
422
424
this . handleStartInteraction ( ) ;
423
425
const { onTransitionStart } = this . props ;
424
- onTransitionStart && onTransitionStart ( { closing : false } ) ;
426
+ onTransitionStart &&
427
+ onTransitionStart ( { closing : ! isVisibleVal } ) ;
425
428
this . handleTransitionEnd ( ) ;
426
- this . props . onOpen ( true ) ;
429
+ if ( isVisibleVal ) {
430
+ this . props . onOpen ( true ) ;
431
+ } else {
432
+ this . props . onClose ( true ) ;
433
+ }
427
434
}
428
435
}
429
436
) ,
@@ -514,7 +521,6 @@ export default class Card extends React.Component<Props> {
514
521
call ( [ this . isVisible ] , ( [ value ] : ReadonlyArray < Binary > ) => {
515
522
const isOpen = Boolean ( value ) ;
516
523
const { onOpen, onClose } = this . props ;
517
-
518
524
this . handleTransitionEnd ( ) ;
519
525
520
526
if ( isOpen ) {
@@ -544,14 +550,18 @@ export default class Card extends React.Component<Props> {
544
550
this . gestureUntraversed ,
545
551
I18nManager . isRTL ? MINUS_ONE_NODE : TRUE_NODE
546
552
) ,
547
- this . gestureUntraversed
553
+ multiply ( this . gestureUntraversed , this . verticalGestureDirection )
548
554
)
549
555
) ,
550
556
set (
551
557
this . velocity ,
552
- multiply (
553
- this . velocityUntraversed ,
554
- I18nManager . isRTL ? MINUS_ONE_NODE : TRUE_NODE
558
+ cond (
559
+ eq ( this . direction , DIRECTION_HORIZONTAL ) ,
560
+ multiply (
561
+ this . velocityUntraversed ,
562
+ I18nManager . isRTL ? MINUS_ONE_NODE : TRUE_NODE
563
+ ) ,
564
+ multiply ( this . velocityUntraversed , this . verticalGestureDirection )
555
565
)
556
566
) ,
557
567
onChange (
@@ -636,7 +646,10 @@ export default class Card extends React.Component<Props> {
636
646
this . gestureUntraversed ,
637
647
I18nManager . isRTL ? MINUS_ONE_NODE : TRUE_NODE
638
648
) ,
639
- this . gestureUntraversed
649
+ multiply (
650
+ this . gestureUntraversed ,
651
+ this . verticalGestureDirection
652
+ )
640
653
) ,
641
654
this . distance
642
655
) ,
0 commit comments