Skip to content

Animating auto height throws a "Partial keyframes not supported" exception when the animated element is in a hidden tab #3968

Closed
@jawadst

Description

@jawadst

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When animating height from * (auto) to 0 on an element inside a tab that is not the current tab (ie hidden), the height of the element should be set to 0

What is the current behavior?

Throws a "Partial keyframes not supported" exception:
ERROR DOMException: Failed to execute 'animate' on 'Element': Partial keyframes are not supported. at WebAnimationsPlayer._triggerWebAnimation (https://unpkg.com/@angular/animations/bundles/animations-browser.umd.js:2319:35) at WebAnimationsPlayer.init (https://unpkg.com/@angular/animations/bundles/animations-browser.umd.js:2302:29) at InjectableAnimationEngine.DomAnimationEngine._queuePlayer (https://unpkg.com/@angular/animations/bundles/animations-browser.umd.js:1593:16) at InjectableAnimationEngine.DomAnimationEngine.animateTransition (https://unpkg.com/@angular/animations/bundles/animations-browser.umd.js:1508:14) at InjectableAnimationEngine.DomAnimationEngine.setProperty (https://unpkg.com/@angular/animations/bundles/animations-browser.umd.js:1379:18) at AnimationRenderer.setProperty (https://unpkg.com/@angular/platform-browser/bundles/platform-browser-animations.umd.js:234:26) at DebugRenderer2.setProperty (https://unpkg.com/@angular/core/bundles/core.umd.js:13269:23) at setElementProperty (https://unpkg.com/@angular/core/bundles/core.umd.js:9544:19) at checkAndUpdateElementValue (https://unpkg.com/@angular/core/bundles/core.umd.js:9463:13) at checkAndUpdateElementInline (https://unpkg.com/@angular/core/bundles/core.umd.js:9397:24) at checkAndUpdateNodeInline (https://unpkg.com/@angular/core/bundles/core.umd.js:12090:23) at checkAndUpdateNode (https://unpkg.com/@angular/core/bundles/core.umd.js:12065:16) at debugCheckAndUpdateNode (https://unpkg.com/@angular/core/bundles/core.umd.js:12694:59) at debugCheckRenderNodeFn (https://unpkg.com/@angular/core/bundles/core.umd.js:12673:13) at Object.eval [as updateRenderer] (ng:///PlunkerAppModule/AppComponent.ngfactory.js:186:5)

The keyframes obtained for the animation:
[{ "height": "", "display": "", "overflow": "hidden", "easing": "ease-in", "offset": 0 }, { "height": "0", "display": "", "overflow": "hidden", "offset": 1 }]

The height of the first keyframe is empty whereas it should be the actual height of the element as it's the start of the transition visible => hidden. Using a fixed height instead of * works fine.

What are the steps to reproduce?

Plunkr: http://plnkr.co/edit/DV5ciU9QbAQkH6wM5to0?p=preview

Which versions of Angular, Material, OS, browsers are affected?

Chrome (works fine on Firefox)
Angular > 4
Material 2 beta 3

Is there anything else we should know?

It only happens when the animation is fired in an async fashion (with a setTimeout, a Promise/Observable, etc.).

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions