-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Table] Sort arrows are not rendered properly in tabs #7291
Comments
I was able to reproduce the issue and I suspect what is happening here is that you are setting an invalid direction (e.g. 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. |
Hi Good try, but I think it's not the problem. In fact, I found something interesting. It's when I use a
The second table "families" will have a ugly arrow even with with a sort "asc" or "desc" |
@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 Regards NB: I will try to do a plunkr |
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 |
This is the plunker :) https://plnkr.co/edit/Idc73Kn0ViLI4Qpsp98g?p=preview Go on the second tab => "family" |
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. |
Hello, any news about this bug ? :) |
Coming soon - looks like this is similar to a wider issue with tabs not playing nice with Angular's content projection. In short, components in tabs are initialized without actually being on the DOM, which breaks for some animations (e.g. expansion panel). Sorry for the wait on this |
@andrewseguin, don't be sorry. I just asking the status about the issue even if I'm sure, there are some others issues (high priority) which need to be fixed ASAP. |
Still an issue on Angular 5.2.2 and Material 5.1.0 |
Keep an eye on #8921 for the fix. When it's merged then you can make it so that your tabs load lazily which means Angular animations will work correctly for content in tabs |
It's a very very very bad bug for performance (@angular/material^5.2.0)
|
Using 6.0.0 Beta and lazily-loaded tabs "fixes" the issue but it shouldn't be necessary (also, using lazy tabs is not necessarily wanted depending on the app)... |
I found a workaround for this: The first time I change to the tab with the table, I call a method which does the following: table.ngOnDestroy(); Note that table is the MatTable object and dataSource is bound to the table: It's not a good solution and kind of a hack, but it works for me. Maybe this helps some other people too. |
@sielver not working unfortunately In gif i have tried to show what is the real problem |
@androidovshchik I've had it working on my end. Not an ideal solution but no glitch to be seen. See here for an example for wrapping tabs within edit: fixed url |
Thanks @Barbiero |
Thanks @Barbiero this solution works fine |
To complete @ganeshkantu sayings, the arrow appears for the active sortable column only on sort action (click on the column). Turning the Does anyone know how this state work ? |
using @Barbiero fix has two issues for me:
my code looks like this:
|
So even with Version Angular Material 6.0.1, this misbehaviour still occurs :( |
Same here. Can't wait to have an update on this matters. This glitch is killing me! |
Scratch that, lazy-loading the tab content seems to fix the issue. |
tl:dr - Upgrade to Material 6.3.0. In case anyone is coming up on this bug now - it appears to have been resolved for Material 6.3.0. At the time I post this a lot of new projects (including mine) were starting on Material 6.2.1, as there was/is a bug in the new Angular 6 |
It's still an issue for me after upgrading, but only noticeable when hovering over sort headings or switching back and forth between tabs. Currently on ng 6.1.2 and material 6.4.3 Lazy loading the tab content fixes the sort issue, but breaks the dynamicHeight functionality because the content needs to re-render every time you switch tabs... |
Will this be backported to Angular 5 if fixed? I just ran into this in 5.2.5 and we've only got corporate approval for Angular 5. |
which material version has the fix? so I can upgrade to it. |
I fixed it with default CSS. As the script adds the styling inline, that styling will overwrite the default CSS, so the arrows will show as expected.
|
Presently on angular-material v6.3.0 I have multiple tabs that contain sortable tables, this sort arrow render issue only shows as expected on one of the sortable tables, all other tables have this rendering issue. After the initial click of that column header, the arrow is then rendered as expected until the page is reloaded. Any update on a fix for this issue? |
The issue was due to mat-table in mat-tab |
Thank you very much. It works perfectly. |
I still have this issue https://gyazo.com/d5b184b83fe43eb58196705ac5d9a4c6 with navigation tabs |
same issue present also in the current angular-material documentation https://material.angular.io/components/table/overview#sorting Chrome: Version 75.0.3770.142 (Official Build) (64-bit) |
But it is removing the sorting functionality |
Fixed in #30057. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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?
What is the expected behavior?
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 #
The text was updated successfully, but these errors were encountered: