Skip to content

bug(matTooltip): tooltip doesn't work with ChangeDetectionStrategy.OnPush #24959

@PavelTurk

Description

@PavelTurk

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I have a table with tooltips inside rows:

 <ng-container matColumnDef="icons">
    <th mat-header-cell *matHeaderCellDef>#</th>
    <td mat-cell *matCellDef="let element">
      <span [matTooltip]="'Hello, world'" matTooltipPosition="below"
        >tooltip</span>
    </td>
  </ng-container>

The table can have thousands of rows, that's why I have to use ChangeDetectionStrategy.OnPush. However, with such strategy tooltips are shown without text.

Reproduction

StackBlitz demo is here

Expected Behavior

Tooltips must be shown with text.

Actual Behavior

Tooltips are shown without text

Environment

  • Angular: 13.3.9
  • CDK/Material: 13.3.7
  • Browser(s): FF 95
  • Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu

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