Skip to content

Using animateChild() in a group() doesn't always run properly #32133

Closed

Description

@rooby

🐞 bug report

Affected Package

This issue relates to the @angular/animations package.

Is this a regression?

I'm not sure.

Description

When I try to run parent and child animations at the same time with group() and animateChild(), the child animation doesn't always animate smoothly.

The same child animation works correctly when it is used by itself.

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-issue-repro2-ih4qhl

Instructions to reproduce with reproduction demo:

  1. Click the heading "Click me to expand & collapse the content below" to expand the section below the heading.
  2. Click the heading again to collapse the section below.

After step 1 you see the colour of the whole section, including the title, change to grey and once that finishes the body text below the title expands suddenly. This is the bug, because the child's height animation is not running smoothly, in parallel with the parent animation.

After step 2 you see the body text collapse and the colour change back to white, both gradually and at the same time.

What I would expect to happen is that in both cases, both the animations run smoothly, in parallel.

🔥 Exception or Error

There appears to be no error when this happens.

🌍 Your Environment

Node: 10.16.2
NPM: 6.9.0

Angular Version:


@angular/animations: 8.1.2
@angular/cdk: 8.1.1
@angular/common: 8.1.2
@angular/compiler: 8.1.2
@angular/core: 8.1.2
@angular/forms: 8.1.2
@angular/platform-browser: 8.1.2
@angular/platform-browser-dynamic: 8.1.2
@angular/router: 8.1.2

It also happens in 8.2.2 in the stackblitz that is linked above.

Anything else relevant?
I have seen this in my app in Chrome and Edge. It doesn't seem to be browser specific.

Activity

  1. added
    area: animations
    on Aug 14, 2019
  2. added this to the needsTriage milestone on Aug 14, 2019
  3. modified the milestones: needsTriage, Backlog on Aug 15, 2019
  4. JurJean commented on Aug 29, 2019

    @JurJean

    It has something to do with height: '*'.

  5. rooby commented on Aug 29, 2019

    @rooby
    Author

    Ah thanks for the info. I can confirm, if I change my animation to use a fixed height it works as expected. That also makes sense as to why it was always working on close but not open.

  6. added
    P3
    and removed on Oct 1, 2020
  7. added a commit that references this issue on Jan 7, 2022
    898b569
  8. added a commit that references this issue on Jan 13, 2022
    af0a152
  9. dario-piotrowicz commented on Jan 14, 2022

    @dario-piotrowicz
    Contributor
  10. angular-automatic-lock-bot commented on Feb 14, 2022

    @angular-automatic-lock-bot

    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.

  11. locked and limited conversation to collaborators on Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area: animationsfreq1: lowstate: confirmedtype: bug/fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions