Skip to content

[Table] Sort arrows are not rendered properly in tabs #7291

Description

@kevincaradant

Bug, feature request, or proposal:

BUG
Plunker: https://plnkr.co/edit/Idc73Kn0ViLI4Qpsp98g?p=preview

When you set your sort by default as ASC or DESC like that:

@ViewChild(MatSort) mdSort: MatSort;

ngOnInit() {this.mdSort.start = 'desc';}

The arrow is just ugly ( 2 times on 3 ). If you click again on the sort icon, it's pretty :)

BTW: Under IE11 it's always ugly. Same issue or not I don't know

What is the current behavior?

image

What is the expected behavior?

image

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

Angular 4.4.3
OS: Windows 7 Pro 64 bits
TS: 2.4.1
Material: 2.0.0-beta.11
Browser: Chrome V60

Is there anything else we should know?

Nothing #

Activity

  1. changed the title [-]BUG: Ugly arrow on sort for data-table (with arrow by default)[/-] [+]Ugly arrow on sort for data-table (with arrow by default)[/+] on Sep 25, 2017
  2. added
    P3
    on Sep 25, 2017
  3. andrewseguin commented on Sep 27, 2017

    @andrewseguin
    Contributor

    I was able to reproduce the issue and I suspect what is happening here is that you are setting an invalid direction (e.g. ascending instead of asc)

    Plunker to show issue: https://plnkr.co/edit/vf61Yr6tvDtOlKRr9zeN?p=preview

    Can you verify that this was the issue?

    Adding PR #7378 that will throw an error if the direction is invalid.

  4. kevincaradant commented on Sep 28, 2017

    @kevincaradant
    Author

    Hi

    Good try, but I think it's not the problem.

    In fact, I found something interesting. It's when I use a <md-tab> and if my <md-table> is not in the first tab (loaded on the load of the page), the initialization of arrow is bad. Sorry I didn't have the time to do a plunker now ( if you don't understand, I will try to do it begining with yours ) but the idea is something like that:

    <mat-tab-group *ngIf="accountExist">
        <mat-tab label="{{'USER' | translate}}">
            <mat-card fxLayout="column">
              <mat-card-content>
                <app-info-user></app-info-user>  // my first <md-table> is inside this component
              </mat-card-content>
            </mat-card>
        </mat-tab>
    
        <mat-tab label="{{'FAMILY' | translate}}">
            <mat-card fxLayout="column">
              <mat-card-content>
                <app-families-user></app-families-user> // my second <md-table> is inside this component
              </mat-card-content>
            </mat-card>
        </mat-tab>
    </mat-tab-group>
    

    The second table "families" will have a ugly arrow even with with a sort "asc" or "desc"

  5. kevincaradant commented on Oct 1, 2017

    @kevincaradant
    Author

    @andrewseguin , Have you seen my previous message, why this issue is closed ?

    It's not the same problem, so the solution mentioned in your PR will throw only the error but I will continue to get this error because the name "asc" is correct. For me, it's just link to the <md-table> which is included in a <md-tab> :)

    Regards

    NB: I will try to do a plunkr

  6. andrewseguin commented on Oct 1, 2017

    @andrewseguin
    Contributor

    Hey yeah - let's open this back up to figure out what's going on. Sounds like perhaps animations isn't firing off.

    Definitely try and get a plunker going so we can dive into this. Thanks

  7. kevincaradant commented on Oct 1, 2017

    @kevincaradant
    Author

    This is the plunker :)

    https://plnkr.co/edit/Idc73Kn0ViLI4Qpsp98g?p=preview

    Go on the second tab => "family"

  8. andrewseguin commented on Oct 6, 2017

    @andrewseguin
    Contributor

    Great thanks for the repro. Looks like the states are being set properly but the animations framework isn't animating the arrow. I'll talk to the core animations guy to see if we can dive into this and see why it's not triggering.

  9. changed the title [-]Ugly arrow on sort for data-table (with arrow by default)[/-] [+][Table] Sort arrows are not rendered properly in tabs[/+] on Oct 19, 2017
  10. added
    P2
    on Oct 19, 2017
  11. 41 remaining items

  12. EricParks commented on Dec 24, 2018

    @EricParks

    material-table-t

    Still an issue for me in Material 7.2.0. Can't put a sortable table inside of a mat tab group. The table header arrow changes to a "T" after clicking one of the parent tabs.
  13. manishvyas1911 commented on Jan 13, 2019

    @manishvyas1911

    The issue was due to mat-table in mat-tab
    You just need to lazy load mat-tab.

  14. eddyzhu1980 commented on Jan 16, 2019

    @eddyzhu1980

    The issue was due to mat-table in mat-tab
    You just need to lazy load mat-tab.

    Thank you very much. It works perfectly.

  15. IrinaPyl commented on May 20, 2019

    @IrinaPyl

    I still have this issue https://gyazo.com/d5b184b83fe43eb58196705ac5d9a4c6 with navigation tabs mat-tab-nav-bar.
    Angular: 7.2.15
    Material: 7.2.2
    Typescript: 3.2.4
    Chrome: 74.0.3729.157 (Official Build) (64-bit)
    OS: macOS Mojave 10.14.4

  16. vzR commented on Jul 25, 2019

    @vzR

    same issue present also in the current angular-material documentation https://material.angular.io/components/table/overview#sorting
    image

    Chrome: Version 75.0.3770.142 (Official Build) (64-bit)
    OS: Windows 10 64-bit

  17. femtozer commented on Jan 24, 2020

    @femtozer

    I still have rendering issues with these arrows :
    Screenshot 2020-01-24 at 13 16 07

    Angular: 8.3.20
    Material: 8.2.3
    Typescript: 3.5.3
    Chrome: 79.0.3945.117 (Official Build) (64-bit)
    OS: macOS Mojave 10.14.6

  18. MoshinaT commented on Mar 23, 2020

    @MoshinaT

    Scratch that, lazy-loading the tab content seems to fix the issue.
    Try putting around your tab content to fix the rendering issue.
    https://material.angular.io/components/tabs/overview#lazy-loading

    But it is removing the sorting functionality

  19. removed their assignment
    on Jun 3, 2023
  20. self-assigned this
    on Dec 2, 2024
  21. crisbeto commented on Dec 2, 2024

    @crisbeto
    Member

    Fixed in #30057.

  22. angular-automatic-lock-bot commented on Jan 2, 2025

    @angular-automatic-lock-bot

    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.

  23. locked and limited conversation to collaborators on Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2area: material/table

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions