diff --git a/tns-core-modules/ui/animation/keyframe-animation.ts b/tns-core-modules/ui/animation/keyframe-animation.ts index 29800b135..79e0abaa2 100644 --- a/tns-core-modules/ui/animation/keyframe-animation.ts +++ b/tns-core-modules/ui/animation/keyframe-animation.ts @@ -212,9 +212,14 @@ export class KeyframeAnimation implements KeyframeAnimationDefinition { let animationDef = this.animations[index]; (animationDef).target = view; let animation = new Animation([animationDef]); + // Catch the animation cancel to prevent unhandled promise rejection warnings animation.play().then(() => { this.animate(view, index + 1, iterations); - }); + }).catch((error: any) => { + if (error.message.indexOf("Animation cancelled") < 0) { + throw error; + } + }); // tslint:disable-line this._nativeAnimations.push(animation); } }