question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The animations docs need to be improved regarding elements entering and leaving (`:enter`, `:leave`)

See original GitHub issue

Issue Description

Currently the animations documentation doesn’t specify clearly what elements are animatable via :enter and :leave

As far as I can tell the only text saying something of that sort is this: https://angular.io/guide/transition-and-triggers#use-of-ngif-and-ngfor-with-enter-and-leave which I believe it’s vague at best 😓

Not even the query api docs, nor the transition api docs say anything about the restrictions/rules around entering/leaving elements

Contex

This has lead to misunderstanding and issues being opened (such as #30477)

Related to this, not even the animations live example works smoothly as it doesn’t seem to take this aspect into account (for example try to navigate from Filter/Stagger to Open/Close, you will see that the yellow box’s animation doesn’t get triggered as you’d expect it to)

Solution

The documentations should be improved and should make very clear what :enter and :leave applies to

Relevant points

  • the only elements considering by :enter and :leave are host elements and elements with structural directives
  • query is clearly being effected (as you can see in the discussion in #30477), I think that transition could be the same, other animation’s api functions could also be affected by this so this should be investigated I believe
  • both the api docs and the animation guides should make clear what elements are considered as entering/leaving
  • the animations live example should be improved so that it works more smoothly/correctly and it also exemplifies the entering/leaving nuances (suggestion: with the live example’s improvement, a docregion can be added with a section in the animations guide showcasing how to properly query entering elements, especially during routing)

TODOs

  • improve the query api docs with the entering/leaving elements information
  • improve the transition api docs with the entering/leaving elements information
  • improve the animations live examples (in regards to entering/leaving elements)
  • improve the general animations guide with the entering/leaving elements information

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dario-piotrowiczcommented, Nov 23, 2021

@petebacondarwin I would love to take this one on, could I be assigned to it? 🙇 🙏

0reactions
angular-automatic-lock-bot[bot]commented, May 25, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to animate :enter & :leave transitions conditionally in ...
For elements entering or leaving a page (inserted or removed from the DOM), you can make the animations conditional. For example, use *ngIf...
Read more >
Apply multiple animation effects to one object - Microsoft Support
On the Animations tab, click Animation Pane. Open the Animation Pane. Click Add Animation, and pick an animation effect. Add an animation effect...
Read more >
Animation transitions and triggers - Angular
This section shows how to animate elements entering or leaving a page. ... This example has a special trigger for the enter and...
Read more >
Start an activity using an animation - Android Developers
You can specify custom animations for enter and exit transitions and for transitions of shared elements between activities. Figure 1.
Read more >
Getting Started With Animations For Angular: Fade + FadeSlide
Do you want to improve the user experience for your angular app? ... we will add a fade animation for when an element...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found