Skip to content

bug(mat-tab-group): Quadratic Number of Renderings inside ngFor #23181

Open

Description

Reproduction

Use StackBlitz to reproduce your issue:

https://stackblitz.com/edit/components-issue-kuvx4a

Steps to reproduce:
On Load of example.component observe the number of render counts

Expected Behavior

Given m tabs and n items, expected render count is m * n

Actual Behavior

The number of render counts follows the equation (see image below).

image

or in Big O

image

Render Counts

n/m 1 2 3 4
1 4 5 6 7
2 12 16 20 24
3 24 33 42 51
4 40 56 72 88
5 60 85 110 135
6 84 120 156 192
7 112 161 210 259
8 144 208 272 336

Environment

  • Angular: 12.0.3
  • CDK/Material: 12.0.4
  • Browser(s): Google Chrome (version 91)
  • Operating System: Windows

Notes: using ChangeDetectionStrategy.OnPush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tabsneeds: discussionFurther discussion with the team is needed before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions