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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:enter animation doesn't animate opacity #46833

Closed
ilyakonrad opened this issue Jul 14, 2022 · 4 comments
Closed

:enter animation doesn't animate opacity #46833

ilyakonrad opened this issue Jul 14, 2022 · 4 comments

Comments

@ilyakonrad
Copy link

ilyakonrad commented Jul 14, 2022

Which @angular/* package(s) are the source of the bug?

animations

Is this a regression?

Yes

Description

I have some components that should be rendered and destroyed with animation which changes transform, border radius and opacity properties, so I use :enter and :leave animations. It worked perfectly prior to upgrading to v14.

Now in v14 :leave animation is working as it did in v13, while :enter stopped animating opacity.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-ivy-5ktwcj

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 14.0.5
Node: 16.13.1
Package Manager: yarn 1.22.15 
OS: win32 x64

Angular: 14.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                            Version
------------------------------------------------------------  
@angular-devkit/architect          0.1400.5
@angular-devkit/build-angular      14.0.5
@angular-devkit/core               14.0.5
@angular-devkit/schematics         14.0.5
@angular/cdk                       14.0.4
@angular/fire                      7.4.1
@angular/material                  14.0.4
@angular/material-moment-adapter   14.0.4
@schematics/angular                14.0.5
rxjs                               6.6.7
typescript                         4.6.4
webpack                            5.73.0

Anything else?

Here's how it worked in the version 13.3.11 https://stackblitz.com/edit/angular-ivy-dtsfmi.
Same code, same everything except the version of @angular/animations.

Also here's my animations setup:

animations: [
  trigger('popupAnimation', [
    transition(':enter', [
      group([
        query('.ns-popup-overlay', style({ opacity: 0 })),
        query('.ns-popup', style({ transform: 'scale(0.95) translateY(-50px)', borderRadius: '24px' })),
        query('.ns-popup-overlay', animate('0.3s ease-in-out', style({ opacity: 1 }))),
        query(
          '.ns-popup',
          animate('0.3s ease-in-out', style({ transform: 'scale(1) translateY(0)', borderRadius: '6px' }))
        )
      ])
    ]),
    transition(':leave', [
      group([
        query('.ns-popup-overlay', style({ opacity: 1 })),
        query('.ns-popup', style({ transform: 'scale(1) translateY(0)' })),
        query('.ns-popup-overlay', animate('0.3s ease-in-out', style({ opacity: 0 }))),
        query('.ns-popup', animate('0.3s ease-in-out', style({ transform: 'scale(0.9) translateY(0)' })))
      ])
    ])
  ])
]
@ngbot ngbot bot added this to the needsTriage milestone Jul 14, 2022
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue Jul 17, 2022
…tyles

style values get added to the _globalTimelineStyles map in order to keep
them so that they can be used across different timelines

_globalTimelineStyles was previsouly a plain object but has been
refactored to a map in angular#44482, as part of the update a check has been
changed from a ternary operation to an or, causing falsy values not to
be added to the map anymore, re-apply a ternary operation check so that
the original behavior is restored

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves angular#46833
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue Jul 17, 2022
…tyles

style values get added to the `_globalTimelineStyles` map in order to keep
them so that they can be used across different timelines

`_globalTimelineStyles` was previsouly a plain object but has been
refactored to a map in angular#44482, as part of the update a check has been
changed from a ternary operation to an or, causing falsy values not to
be added to the map anymore, re-apply a ternary operation check so that
the original behavior is restored

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves angular#46833
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue Jul 17, 2022
…tyles

style values get added to the `_globalTimelineStyles` map in order to keep
them so that they can be used across different timelines

`_globalTimelineStyles` was previously a plain object but has been
refactored to a map in angular#44482, as part of the update a check has been
changed from a ternary operation to an or, causing falsy values not to
be added to the map anymore, re-apply a ternary operation check so that
the original behavior is restored

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves angular#46833
@dario-piotrowicz
Copy link
Contributor

@ilyakonrad good catch! the bug is indeed a regression caused by some accidental refactoring, a fix is on its way 🙂 🎉

Also thank you very much for all the information and the nice reproductions! they've been very helpful! 😄

@ilyakonrad
Copy link
Author

ilyakonrad commented Jul 17, 2022

@dario-piotrowicz Love the term "accidental refactoring", whatever that means 😆
Thanks for the quick response!

@dario-piotrowicz
Copy link
Contributor

dario-piotrowicz commented Jul 17, 2022

@dario-piotrowicz Love the term "accidental refactoring", whatever that means laughing Thanks for the quick response!

yeah sorry for the silly term 😆 , anyways I was trying to say that some refactoring broke it by mistake, I'm sure you got the gist of it! 😆

dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue Jul 18, 2022
…tyles

style values get added to the `_globalTimelineStyles` map in order to keep
them so that they can be used across different timelines

`_globalTimelineStyles` was previously a plain object but has been
refactored to a map in angular#44482, as part of the update a check has been
changed from a ternary operation to an or (||), causing falsy values (as 0)
not to be added to the map anymore, apply the nullish coalescing operator (??)
instead to make sure only `undefined` and `null` are filtered out

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves angular#46833
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this issue Jul 18, 2022
…tyles

style values get added to the `_globalTimelineStyles` map in order to keep
them so that they can be used across different timelines

`_globalTimelineStyles` was previously a plain object but has been
refactored to a map in angular#44482, as part of the update a check has been
changed from a ternary operation to an or (||), causing falsy values (as 0)
not to be added to the map anymore, apply the nullish coalescing operator (??)
instead to make sure only `undefined` and `null` are filtered out

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves angular#46833
jessicajaniuk pushed a commit that referenced this issue Jul 18, 2022
…tyles (#46863)

style values get added to the `_globalTimelineStyles` map in order to keep
them so that they can be used across different timelines

`_globalTimelineStyles` was previously a plain object but has been
refactored to a map in #44482, as part of the update a check has been
changed from a ternary operation to an or (||), causing falsy values (as 0)
not to be added to the map anymore, apply the nullish coalescing operator (??)
instead to make sure only `undefined` and `null` are filtered out

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves #46833

PR Close #46863
jessicajaniuk pushed a commit that referenced this issue Jul 18, 2022
…tyles (#46863)

style values get added to the `_globalTimelineStyles` map in order to keep
them so that they can be used across different timelines

`_globalTimelineStyles` was previously a plain object but has been
refactored to a map in #44482, as part of the update a check has been
changed from a ternary operation to an or (||), causing falsy values (as 0)
not to be added to the map anymore, apply the nullish coalescing operator (??)
instead to make sure only `undefined` and `null` are filtered out

also since this aspect was clearly not covered by tests, add a new test
to ensure that such regression doesn't happen in the future

resolves #46833

PR Close #46863
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants