Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation using query and stagger doesn't properly animate from height: '*' #31520

Open
brianmtreese opened this issue Jul 11, 2019 · 0 comments
Labels
area: animations freq2: medium P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent state: confirmed type: bug/fix
Milestone

Comments

@brianmtreese
Copy link

馃悶 bug report

Affected Package

@angular/animations: 8.1.1

Is this a regression?

I'm not sure.

Description

When attempting to use an animation query with a stagger to animate from an unknown height height: '*', the animation does not work. It works fine when animating from a known height to an unknown height though.

For example, this works correctly:

animations: [
    trigger('expandCollapse', [
      transition('false => true', [
        query('.category', [
          style({ height: 0 })
        ]),
        query('.category', stagger('150ms', [
          animate(
              '600ms cubic-bezier(0.25, 0.8, 0.25, 1)',
              style({ height: '*' })
          )
        ]), { optional: true })
      ])
    ])

But this does not:

animations: [
    trigger('expandCollapse', [
      transition('true => false', [
        query('.category', stagger('-150ms', [
          style({ height: '*' }),
          animate(
              '600ms cubic-bezier(0.25, 0.8, 0.25, 1)',
              style({ height: 0 })
          )
        ]), { optional: true })
      ])
    ])

馃敩 Minimal Reproduction

https://stackblitz.com/edit/angular-unknown-height-query-animation-bug?file=src/app/app.component.ts

In this example, if you click the "show" button you will see it animate to an unknown height just fine. But, once it's expanded and you click the "hide" button you will see that it doesn't properly animate from an unknown height back to zero.

@ngbot ngbot bot added this to the needsTriage milestone Jul 12, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Aug 15, 2019
@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed severity3: broken labels Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: animations freq2: medium P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent state: confirmed type: bug/fix
Projects
None yet
Development

No branches or pull requests

4 participants