File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
src/ui-persistent-bottomsheet Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ export class PersistentBottomSheet extends GridLayout {
109
109
private _isScrollEnabled = true ;
110
110
private scrollViewAtTop : boolean = true ;
111
111
112
+ private animation : Animation ;
113
+
112
114
constructor ( ) {
113
115
super ( ) ;
114
116
this . isPassThroughParentEnabled = true ;
@@ -522,6 +524,9 @@ export class PersistentBottomSheet extends GridLayout {
522
524
523
525
animating = false ;
524
526
private async animateToPosition ( position , duration = OPEN_DURATION ) {
527
+ if ( this . animation ) {
528
+ this . animation . cancel ( ) ;
529
+ }
525
530
if ( this . animating ) {
526
531
return ;
527
532
}
@@ -562,18 +567,22 @@ export class PersistentBottomSheet extends GridLayout {
562
567
} )
563
568
. filter ( ( a ) => ! ! a ) ;
564
569
try {
565
- await new Animation ( params ) . play ( ) ;
570
+ this . animation = new Animation ( params ) ;
571
+ await this . animation . play ( ) ;
566
572
} catch ( err ) {
573
+ //ensure we go to end position
574
+ this . applyTrData ( trData ) ;
567
575
console . error ( 'BottomSheet animation cancelled' , err ) ;
568
576
} finally {
569
577
this . isScrollEnabled = true ;
570
578
this . animating = false ;
571
- if ( position !== 0 ) {
572
- } else {
573
- // if (this.backDrop) {
574
- // this.backDrop.visibility = 'hidden';
575
- // }
576
- }
579
+ this . animation = null ;
580
+ // if (position !== 0) {
581
+ // } else {
582
+ // // if (this.backDrop) {
583
+ // // this.backDrop.visibility = 'hidden';
584
+ // // }
585
+ // }
577
586
}
578
587
}
579
588
}
You can’t perform that action at this time.
0 commit comments