components icon indicating copy to clipboard operation
components copied to clipboard

bug(MatTooltip): matTooltipClass not working with angular 16

Open josejaner opened this issue 3 years ago • 3 comments

Is this a regression?

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

The previous version in which this bug was not present was

14.2.11

Description

any modification with matTooltipClass, doesn't work

image

image

Reproduction

StackBlitz link: Steps to reproduce: 1. 2.

Expected Behavior

make custom changes

Actual Behavior

does not show any change

Environment

  • Angular: 16.1.0
  • CDK/Material: 16.1.0
  • Browser(s): Google Chrome
  • Operating System (Windows)

josejaner avatar Jun 14 '23 00:06 josejaner

The class is being added, but the tooltip isn't what is being styled, it's a child element of the tooltip: You might want to target it specifically:

.mat-tooltip .mdc-tooltip__surface {
  color: red;
}

https://stackblitz.com/edit/components-issue-jft2ro?file=src%2Fapp%2Fexample-component.html,src%2Fapp%2Fexample-component.css,src%2Fstyles.scss,src%2Fapp%2Fexample-component.ts

wartab avatar Jun 15 '23 08:06 wartab

@wartab is correct, with the new implementation you need to target the styles at the .mdc-tooltip__surface child element

mmalerba avatar Jun 15 '23 15:06 mmalerba

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.