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

[Sort] Arrow shown if parent called animateChild() #9844

Closed
hanyu-natsu opened this issue Feb 8, 2018 · 5 comments · Fixed by #30057
Closed

[Sort] Arrow shown if parent called animateChild() #9844

hanyu-natsu opened this issue Feb 8, 2018 · 5 comments · Fixed by #30057
Labels
area: material/sort P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@hanyu-natsu
Copy link

hanyu-natsu commented Feb 8, 2018

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Sort header arrow and indicator should animate normally if any parent animation calls "animateChild()" with query.

What is the current behavior?

The mat-sort-header-arrow animation is stuck with "ng-animate-queued" status. All arrows are shown when the DOM is rendered.

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

https://stackblitz.com/edit/angular-material2-issue-6jcfm7?file=main.ts

What is the use-case or motivation for changing an existing behavior?

Add fade in animation to the table when entering. This was working in 5.1.0.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular material & cdk 5.2.0

Is there anything else we should know?

@andrewseguin
Copy link
Contributor

Yeesh, weird bug. Thanks for reporting

@Personne0012
Copy link

Hello,
I encounter similar issue, but that seems not to be only related with animateChild().
I made a mat-tab-group where each tab contains a sortable mat-table and I declare an animation trigger in my component.

When first tab is initially render all arrows are as they must be.
When navigate to following tabs, all arrows are shown as described by @lihanyu23 .
Finally when come back on previous tabs, all arrows have a very weird behavior.

The issue still appears even if you don't use this animation by removing binds of trigger from template and even with a void animation (trigger('animation', []).
The only ways to obtain the expected behavior from what I saw, is to remove component's animation declaration.(I could lazyloads tabs's content too as a workaround).

I made a little StackBlitz to reproduce the issue : https://stackblitz.com/edit/angular-material2-issue-6s8ykr

Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular : at least from 5.2.1 to 6.0.0-beta.4
Material : at least from 5.2.0 to 6.0.0-beta-0
OS: Windows7, Android
TS: 2.5.3
Browsers: Chrome (Desktop & Android), FF, IE11

Hope this can help to fix this bug.
Regards.

@hanyu-natsu
Copy link
Author

Hi, @Personne0012 ,

Thank you for sharing your issue.

I have looked at your stackblitz, I believe that your issue is caused by the tab-body's "@ translateTab" animation which is played when switching tab from one to another. That's why the sort header indicators display well in the first tab rendered and become weird when navigating to another.

They are all related to their parent's animations.

@andrewseguin andrewseguin changed the title Sort header arrow always shown if parent animation calls animateChild() [Sort] Arrow shown if parent called animateChild() Apr 23, 2018
@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Apr 23, 2018
@sea-erkin
Copy link

sea-erkin commented Apr 30, 2018

I was experiencing this when I had my table working in a mat-tab-group. I switched to a nav mat-tab-nav-bar similar to this example (https://github.com/angular/material2/blob/master/src/demo-app/table/table-demo-page.html) and am no longer experiencing the issue.

@andrewseguin andrewseguin removed their assignment Jun 3, 2023
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 21, 2024
For a long time the sort header's animation was set up by rendering out 4 `div` elements and then arranging them to look like an arrow. This is somewhat complicated to maintain, difficult to customize, in some cases it leads to weird visual bugs and ends up triggering excessive change detections. On top of that, because it depends on `@angular/animations`, it is prone to memory leaks (see angular/angular#54149).

These changes aim to simplify the component and make it more robust by using an `svg` icon and dealing with the animations.

Fixes angular#9758.
Fixes angular#9844.
Fixes angular#10088.
Fixes angular#15451.
Fixes angular#19441.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 21, 2024
For a long time the sort header's animation was set up by rendering out 4 `div` elements and then arranging them to look like an arrow. This is somewhat complicated to maintain, difficult to customize, in some cases it leads to weird visual bugs and ends up triggering excessive change detections. On top of that, because it depends on `@angular/animations`, it is prone to memory leaks (see angular/angular#54149).

These changes aim to simplify the component and make it more robust by using an `svg` icon and dealing with the animations.

Fixes angular#9758.
Fixes angular#9844.
Fixes angular#10088.
Fixes angular#15451.
Fixes angular#19441.
Fixes angular#10242.
crisbeto added a commit that referenced this issue Nov 27, 2024
For a long time the sort header's animation was set up by rendering out 4 `div` elements and then arranging them to look like an arrow. This is somewhat complicated to maintain, difficult to customize, in some cases it leads to weird visual bugs and ends up triggering excessive change detections. On top of that, because it depends on `@angular/animations`, it is prone to memory leaks (see angular/angular#54149).

These changes aim to simplify the component and make it more robust by using an `svg` icon and dealing with the animations.

Fixes #9758.
Fixes #9844.
Fixes #10088.
Fixes #15451.
Fixes #19441.
Fixes #10242.

(cherry picked from commit a08eeeb)
@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 Dec 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/sort P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants