Skip to content

bug(mat-sort-header): performance & change detection issue with the whole table #19441

Closed
@woteska

Description

@woteska

Reproduction

With Stackblitz I can't reproduce it as dev tools is not working there.

https://ibb.co/XXjZw1r

Steps to reproduce:

  1. Go to official Material page (https://material.angular.io/components/table/overview#sorting)
  2. Press F12
  3. Enable Paint flashing tool
  4. See that if you hover mat-sort-header (not clicking it, just hover), the whole table will be rendered again and again for nothing (even if you leave the sort header).

Expected Behavior

If I have a complex page with Material table, I would not expect performance issues because of re-rendering the whole table on hovering mat-sort-header. Table's data definetely should not connect to mat-sort-header on hover event by default.

Actual Behavior

Causes performance issues.
https://ibb.co/XXjZw1r

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/sortperfThis issue is related to performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions