nativescript-angular: keyframe animations (css) problems using NNG
I ran this by Tsvetan Raikov and we think this is an issue that needs fixing:
In an app scaffolded as per normal in the cli (`tns create myNNGapp --ng) I am attempting to animate cards using keyframe animation:
@keyframes card {
from { opacity: 0 }
to { opacity: 1}
}
.card {
opacity: 0;
background-color: #DA4167;
animation-name: card;
animation-duration: 4s;
animation-iteration-count: 1;
margin: 10;
border-radius: 5;
color: #EBEBD3;
}
The keyframe animation to fade in does work, but in console, I get this error:
CONSOLE LOG file:///app/tns_modules/@angular/core/src/facade/lang.js:360:16: resolvePromise@file:///app/tns_modules/zone.js/dist/zone-node.js:516:41
resolvePromise@file:///app/tns_modules/zone.js/dist/zone-node.js:501:32
file:///app/tns_modules/zone.js/dist/zone-node.js:549:32
invokeTask@file:///app/tns_modules/zone.js/dist/zone-node.js:323:43
onInvokeTask@file:///app/tns_modules/@angular/core/src/zone/ng_zone_impl.js:44:51
invokeTask@file:///app/tns_modules/zone.js/dist/zone-node.js:322:55
runTask@file:///app/tns_modules/zone.js/dist/zone-node.js:223:58
drainMicroTaskQueue@file:///app/tns_modules/zone.js/dist/zone-node.js:455:43
promiseReactionJob@[native code]
UIApplicationMain@[native code]
start@file:///app/tns_modules/application/application.js:233:26
nativeScriptBootstrap@file:///app/tns_modules/nativescript-angular/application.js:144:22
anonymous@file:///app/main.js:5:36
evaluate@[native code]
moduleEvaluation@[native code]
[native code]
promiseReactionJob@[native code]
Sep 2 11:05:55 LOOPERMAC ndduiworkshop[40158]: CONSOLE ERROR file:///app/tns_modules/zone.js/dist/zone-node.js:442:27: Unhandled Promise rejection: Animation cancelled. ; Zone: angular ; Task: Promise.then ; Value: Error: Animation cancelled. _rejectAnimationFinishedPromise@file:///app/tns_modules/ui/animation/animation-common.js:110:31
animationFinishedCallback@file:///app/tns_modules/ui/animation/animation.js:115:57
animationDidStopFinished@file:///app/tns_modules/ui/animation/animation.js:67:35
UIApplicationMain@[native code]
start@file:///app/tns_modules/application/application.js:233:26
nativeScriptBootstrap@file:///app/tns_modules/nativescript-angular/application.js:144:22
anonymous@file:///app/main.js:5:36
evaluate@[native code]
moduleEvaluation@[native code]
[native code]
promiseReactionJob@[native code]
Sep 2 11:05:55 LOOPERMAC ndduiworkshop[40158]: CONSOLE ERROR file:///app/tns_modules/zone.js/dist/zone-node.js:444:23: Error: Uncaught (in promise): Error: Animation cancelled.
Perhaps this could be fixed in the next release.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 61 (7 by maintainers)
Also getting
ERROR Error: Uncaught (in promise): Error: Animation cancelled.This is on tns 3.3 android, angular 4.4.1.The code causing this looks like:
<FlexboxLayout [ngClass]="{'some-animated-css-class' : some-var-that-toggles-true-and-false}"> ...I get the error only when
some-var-that-toggles-true-and-falsegoes from true to false which should remove the css class doing the animation. Also the css animation only takes 2 seconds, but the css class isn’t removed until after like 5 seconds so it’s not like I’m removing the class in the middle of the animation.Maybe this issue need to be reopened?
any updates?
Closing, as with 2.3 keyframe animations work without issue now! 👍
Hi, any updates on this one?
Still facing that problem with nativescript 4.2.4 . steps to reproduce the problem: just install nativescript-ngx-slides plugin and i set some slides inside it and make it autoplay using setInterval function and when i try to make a half swipe(make a swipe and cancel it before going to next slide) i’m getting this error:
CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:676:30: Unhandled Promise rejection: Animation cancelled. ; Zone: <root> ; Task: null ; Value: Error: Animation cancelled. _rejectAnimationFinishedPromise@file:///app/tns_modules/tns-core-modules/ui/animation/animation-common.js:100:31 [<root>] animationFinishedCallback@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:148:57 [<root>] animationDidStopFinished@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:70:35 [<root>] UIApplicationMain@[native code] [<root>] start@file:///app/tns_modules/tns-core-modules/application/application.js:272:26 [<root>] run@file:///app/tns_modules/tns-core-modules/application/application.js:300:10 [<root>] bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:153:26 [<root>] bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:87:38 [<root>]Thanks to @NathanWalker for addressing that with a PR 😃 It’s not included in the 4.1 official release, but it will be available in
@next@alterx I can certainly understand that. Please see PR above.
same here (3.0.1)
This issue continues with tns version: 2.5.1
confirmed I see this issue when using keyframes as well
I’m getting similar errors on navigation animations and also CSS animations. Using 2.3
Like @alqabali & @JillevdW this errors still occurs (ns-angular 7.1.0). In my case I link several animations for a “bounce” effect:
Note : this errors occurs only on iOS for me.
@hdeshev Could you please reopen this issue… I have a PR coming for this.
It really worries me that this kind of issue (with a lot of reports. Mine, for example, dates to late 2016) just gets closed despite the fact that multiple people are reporting the same thing. If it were just an esthetic issue I’d understand but this has the potential to break the app during usage.
Update: @NathanWalker, thanks for looking into this 😃
It’s due to another misusage of ‘throw’ around animation handling - I’ll submt a PR shortly.
Also here:
this is the code:
this is the error
@jlooper - maybe we should reopen this issue.
Also getting that ugly error in the console:
JS: Error: Animation cancelled. JS: at KeyframeAnimation._rejectAnimationFinishedPromise (file:///data/data/org.nativescript.WaterTrend/files/app/tns_modules/tns-core-modules/ui/animation/keyframe-animation.js:208:22) [angular] ...error appears on iOS if you’re going to manipulate element properties while doing some animations
For example: on layout touch => set style translateY of element X for pulldown; but clicking on layout childs tap (icon f.e.) => animate some properties of element X for opening.
=> animation starts => and in touch event you’re going to manipulate manually which will cause the animation to stop.
I have the same issue with tns version: 2.5
same here (2.4.2)
Also, just installed the latest version of the groceries sample and the error is still there when you log out.
I also see this issue on 3.4.1 and 4.0.0
same issue with tns-3.0.1 and ios,everything is normal in android,any solution?