Repository navigation
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: animationslegacy animations package only. Otherwise use area: core.bugstate: has PR
Milestone
Description
Which @angular/* package(s) are the source of the bug?
animations
Is this a regression?
No
Description
When there is a sequenced animation, with animations having a different easing (for example the first animation having an ease-in, and the next animation having an ease-out), a console warning is given about 'easing' not being animatable.
Because easing is not animated, but rather is a property of the animation, the warning is incorrect.
Example animation:
animations: [
trigger('toolbarAnimations', [
state('void, leave', style({ transform: 'translateY(-100%)' })),
state('enter', style({ transform: 'none' })),
transition(':enter', [
sequence([
animate('200ms ease-in', style({ transform: 'none' })),
animate('200ms ease-out', style({ transform: 'translateY(-12px)' })),
animate('250ms ease-in', style({ transform: 'none' })),
]),
]),
transition(':leave', group([animate('300ms ease-in', style({ transform: 'translateY(-100%)' }))])),
])
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
Warning: The animation trigger "toolbarAnimations" is attempting to animate the following not animatable properties: easing
(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 14.2.3
Node: 14.20.1
Package Manager: npm 6.14.17
OS: win32 x64
Angular: 14.2.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1402.3
@angular-devkit/build-angular 14.2.3
@angular-devkit/core 14.2.3
@angular-devkit/schematics 14.2.7
@angular-devkit/schematics-cli 14.1.2
@angular/cdk 14.2.2
@angular/material 14.2.2
@angular/material-moment-adapter 14.2.2
@schematics/angular 14.2.7
ng-packagr 14.3.0
rxjs 6.6.7
typescript 4.6.4
Anything else?
It is still reproducible in Angular 15.0, see stackblitz example
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: animationslegacy animations package only. Otherwise use area: core.bugstate: has PR
Activity
sOoN92 commentedon Dec 22, 2022
You can easily achieve the same result using
ease-in-out, thus avoiding the warning in console.drsno commentedon Dec 22, 2022
This would avoid the warning (workaround the bug), but it will also change the animated result. We are aiming for a bounce effect that isn't achieved by using
ease-in-outin all animations.See https://stackoverflow.com/questions/9629346/difference-between-css3-transitions-ease-in-and-ease-out#9636239 to see why the ease-in-out will give a different effect.
dario-piotrowicz commentedon Dec 23, 2022
@noudenaa I've implemented the non-animatable warnings some time ago, sorry I must have missed the timing functions, I'll look at this very soon 🙂
In the meantime, I hope that this is not blocking you? if I'm not mistaken the non-animatable warnings don't show up in production so this should hopefully just be an inconvenience during dev time?
drsno commentedon Dec 23, 2022
Thanks. It is not blocking, the warnings indeed don't show up in production.
xunillinux commentedon Jan 20, 2023
@dario-piotrowicz I get warnings for trying to animate stroke-dasharray. The animations work.
mdn says stroke-dasharray is animatable (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray)
Can I somehow disable the warning or am I actually doing something wrong?
dario-piotrowicz commentedon Jan 22, 2023
Hi @xunillinux I don't think you are doing anything wrong, the issue is that the check to see if a property is animatable has been implemented following this set of properties: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties
The issue is that your property is an animatable svg one which happens to be also acceptable as css, thus it is not included in the list.
I checked and various other svg attributes would cause the same problem: https://www.w3.org/TR/SVG/propidx.html
The easiest solution for your problem would be to add all of those here:
angular/packages/animations/browser/src/render/web_animations/animatable_props_set.ts
Line 14 in 3a60063
but in order to do that I think we may want to have a definitive source (like the one we have for the css animatable props) (the one I linked above does say that it is just informative, so I am not sure if that's reliable enough)
The alternative would be to allow the developer to specify somewhere the properties they do not want non-animatable warnings for (no, there isn't currently a way to do so 😓), this would also make the warning more configurable. (I think this might be preferred if not many people animate svgs, if svg animation via angular animations is common then maybe we should focus on adding the svg properties instead).
What do you think? Which from your perspective sounds like the way to go?
xunillinux commentedon Jan 25, 2023
Hey @dario-piotrowicz Thank you for your answer.
Okay I don't know how many people use svg animatable properties but I don't think I'm the only one. So maybe it would be good to add those to the list. But nevertheless I think a configuration option for disabling the warning for specific cases might be a good solution. There may be some other usecases where there is an unnecessary warning or maybe some people would choose to ignore the warning on purpose.
dario-piotrowicz commentedon Jan 26, 2023
Cool, I can see that my PR for this current issue is getting merged soon 🙂, after that I'll look into adding the svg props and/or adding an option to disable warnings 🙂👍
@xunillinux if you want please feel free to open an issue and tag me there, otherwise I guess I can just do it without an issue to back it up, whatever you prefer (if you create the issue I'll be easier to keep track of it and you can get notified there 🙂)
fix(animations): fix non-animatable warnings for easing (#48583)
fix(animations): fix non-animatable warnings for easing (angular#48583)
dario-piotrowicz commentedon Feb 11, 2023
@xunillinux regarding svg animatable attributes, I looked into adding them to our list of animatable props but I don't think that that is a viable option, because there are some svg attributes like
displayandoverflowthat conflict with the css list, making the whole check much much less accurate.So instead I've opted to add a way to ignore non-animatable props (#49036) please let me know what you think 🙂
dario-piotrowicz commentedon Feb 11, 2023
@xunillinux If you want please have a look at the PR, especially the unit tests to see how I implemented the disabling and if that looks good for your use cases 🙂
But tldr:
disableAnimatableDevWarningswhen setting up theBrowserAnimationsModuleto completely disable the warning (if it really bothers you all the time)allowedPropsin the specifictransitioncall to fix a one-off issue (if you want the check/warning but it is bothering you in a specific situation)Please let me know what you think 🙂
xunillinux commentedon Mar 8, 2023
@dario-piotrowicz Thanks alot! Yes I had a look at the PR and that should work fine for my case :)
angular-automatic-lock-bot commentedon Apr 8, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.