Skip to content

bug(mat-sort): sort arrow changes, but data is not sorted in the table #26506

@woteska

Description

@woteska

Is this a regression?

I do not know.

The previous version in which this bug was not present was

I do not know.

Description

Data is not sorted in children's table when triggering the children's sorts to work in sync with the parent table's sort.

Reproduction

Steps to reproduce:

  1. Open https://stackblitz.com/edit/angular-yzr1r9-jtjxz6?file=src/app/table-sorting-example.ts
  2. Click on the first 'Name' column on the top 2 times (sort should be active: 'name', direction: 'desc')
  3. Verify that the parent table's rows are sorted correctly (in desc alphabetical order)
  4. And also see that the children's table sort arrow points to the good direction
  5. Also also see that the data is not sorted in the children's table (despite point 4.)
  6. Verify that the children's data sorted only if the children's table header is clicked directly

Note: children's headers are not visible in the real use-case, it is visible now only for the demo.

Expected Behavior

Data should be sorted in all tables.

Actual Behavior

Data is not triggered to be sorted.

Environment

  • Angular: 14
  • CDK/Material: 14
  • Browser(s): Chrome latest
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

See demo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions