New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't set display during animation #27577
Comments
Any news on this? I recently decided to remove all angular animations from my latest app because I'm nervous about sinking a ton of time into a library that is either broken or that I'm failing to comprehend. It's a shame, because angular animations has great potential. |
Will this ever work...? Sure, you could probably work around this using ugly position hacks, but this has numerous drawbacks... style({
position: 'fixed',
visibility: 'hidden',
left: -9999,
top: -9999,
}) At least you should throw an error message if someone uses properties which are not supported. |
FWIW @MagnusBrzenk I'd avoid animations as much as possible. They're indispensable for leave animations (they hook into the renderer), but even then I use TS hooks to add CSS classes. |
Hi @pauldraper the issue here is that the animations are run using the standard web animations, and whilst If you check out the MDN Animatable CSS Properties list you will see that You can also check in the w3c specs the Animation of visibility section, there you can see that visibility gets actually interpolated (between Also in this stackblitz I made you can see that also with standard native css animations So I believe it is totally correct and expected that What I think could be improved here is to at least provide some warnings when you try to animate non-animatable properties. What do you think? 🙂 |
warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577
warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577
warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577
@dario-piotrowicz if this is simply a limitation of the browser API, then this can be closed. |
warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577
warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577
warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577
warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577
…ngular#45212) warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577 PR Close angular#45212
…ngular#45212) warn developers when they are trying to animate non-animatable CSS properties so that can more easily understand why something is not being animated as they would expect it to resolves angular#27577 PR Close angular#45212
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Affected Package
@angular/animation or @angular/platform-browser
Is this a regression?
Unknown.
Description
While animating, it is often helpful to make elements appear and disappear from the layout. The
display
style does this; however Angular will not set a display style while animating.🔬 Minimal Reproduction
Note that the visibility style is set, but the display is not.
https://stackblitz.com/edit/angular-animation-display
🔥 Exception or Error
N/A
🌍 Your Environment
Angular Version:
7.1.2
Anything else relevant?
A workaround is to control the display manually with setTimeouts; however, this is not guaranteed to sync up with the rest of the animations.
The text was updated successfully, but these errors were encountered: