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

bug(table): Programmatic triggering of sort with cdkDropList does not work #18593

Open
ChrisWun opened this issue Feb 24, 2020 · 1 comment
Open
Labels
area: cdk/table P4 A relatively minor issue that is not relevant to core functions

Comments

@ChrisWun
Copy link

ChrisWun commented Feb 24, 2020

Reproduction

Stackblitz: https://stackblitz.com/edit/angular-material-dllyke?file=app/app.component.html
Steps to reproduce:

  1. Sort the Table by column "Name"
  2. Drag and Drop one row

Expected Behavior

The Sort triggered by the method onListDrop does sort the table correctly and the sort indicator of the table-header is not shown at the weight (drag handle) column.

Actual Behavior

Sorting does not work with calling MatSort#sort. With two calls, however, it does. The sorting indicator is removed from the "Name" column, but it is not added to the "Weight" column.

The sort order does not seem to work either. The default sort order is "asc". However, if you set "asc" when calling MatSort#sort , the sort order changes.

Environment

  • Angular:
  • CDK/Material: 8.2.1
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu):
@ChrisWun ChrisWun changed the title Programmatic triggering of sorting for mat-table with cdkDropList and matSort does not work correctly Programmatic triggering of sort for mat-table with cdkDropList and matSort does not work correctly Feb 24, 2020
@mmalerba mmalerba added the needs triage This issue needs to be triaged by the team label May 20, 2020
@andrewseguin
Copy link
Contributor

It's not clear to me why the arrow is not correctly appearing by the column. Will need further investigation

@andrewseguin andrewseguin added area: cdk/table P4 A relatively minor issue that is not relevant to core functions and removed needs triage This issue needs to be triaged by the team labels May 26, 2020
@andrewseguin andrewseguin changed the title Programmatic triggering of sort for mat-table with cdkDropList and matSort does not work correctly bug(table): Programmatic triggering of sort with cdkDropList does not work May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/table P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

3 participants