Skip to content

Animations jump around during router-outlet transitions #23069

@doubleUTF

Description

@doubleUTF

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When switching router pages by clicking navigation links(Projects<-->Users), the leaving component instantly teleports below where the entering component would be, creating a disjointing appearance during animation.

Expected behavior

The leaving component should leave from its current position and not teleport anywhere unless specified in the animations metadata. The desired behavior is to create a seamless transition.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-fjxwoq?file=styling-assignment%2Fapp.component.ts

What is the motivation / use case for changing the behavior?

To create a seamless transition for animating between router pages.

Environment


Angular version: 5.2.8
Angular Animations: 5.2.9


Browser:
- [X ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 9.5.0 
- Platform:  Windows 7 

Others:

I've tried using position:'fixed' in the hosting components and while the the disjointing is fixed, the end state results in a disappearing component. If I add style({transform:'translateY(-100%)'}) to the leaving component, leaving users page appears smooth but that means leaving another page(Servers) with a greater height looks terrible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: animationslegacy animations package only. Otherwise use area: core.freq1: lowtype: bug/fix

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions