Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tooltip): allow providing a global matTooltipClass #29355

Closed
Harpush opened this issue Jun 30, 2024 · 1 comment · Fixed by #29467
Closed

feat(tooltip): allow providing a global matTooltipClass #29355

Harpush opened this issue Jun 30, 2024 · 1 comment · Fixed by #29467
Labels
area: material/tooltip feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions

Comments

@Harpush
Copy link

Harpush commented Jun 30, 2024

Feature Description

Right now the tooltip class can be set on per tooltip basis. I want to declare the class name globally once and it will apply to all tooltips (hence global options token).

Use Case

We have in our app a certain tooltip class we pass to hundreds of tooltips. If we could provide the options on the route (or in root) that needs the specific tooltip class with that class we shouldn't have to remember to pass the class name in each and every tooltip usage.

@Harpush Harpush added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Jun 30, 2024
@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions area: material/tooltip and removed needs triage This issue needs to be triaged by the team labels Jul 3, 2024
jullierme added a commit to jullierme/components that referenced this issue Jul 21, 2024
…ipDefaultOptions

The `tooltipClass` property has been added to the default configuration options in
`MatTooltipDefaultOptions`. This new property is optional and supports the same syntax
as `ngClass`, just like the component's default attribute.
As with some existing configurations, if a CSS class is defined directly on the tooltip
component, it will automatically override the default class. An example has been added
to the `tooltip-demo` file. Additionally, two tests have been created to ensure the
solution works as expected.

Fixes angular#29355
jullierme added a commit to jullierme/components that referenced this issue Jul 21, 2024
…ipDefaultOptions

The `tooltipClass` property has been added to the default configuration options in
`MatTooltipDefaultOptions`. This new property is optional.
As with some existing configurations, if a CSS class is defined directly on the tooltip
component, it will automatically override the default class. Two tests have been created
to ensure the solution works as expected.

Fixes angular#29355
jullierme added a commit to jullierme/components that referenced this issue Jul 21, 2024
…ipDefaultOptions

The `tooltipClass` property has been added to the default configuration options in
`MatTooltipDefaultOptions`. This new property is optional.
As with some existing configurations, if a CSS class is defined directly on the tooltip
component, it will automatically override the default class. Two tests have been created
to ensure the solution works as expected.

Fixes angular#29355
crisbeto pushed a commit that referenced this issue Jul 22, 2024
…efaultOptions (#29467)

* feat(material/form-field): replicate tooltipClass to default MatTooltipDefaultOptions

The `tooltipClass` property has been added to the default configuration options in
`MatTooltipDefaultOptions`. This new property is optional and supports the same syntax
as `ngClass`, just like the component's default attribute.
As with some existing configurations, if a CSS class is defined directly on the tooltip
component, it will automatically override the default class. An example has been added
to the `tooltip-demo` file. Additionally, two tests have been created to ensure the
solution works as expected.

Fixes #29355

* feat(material/form-field): replicate tooltipClass to default MatTooltipDefaultOptions

The `tooltipClass` property has been added to the default configuration options in
`MatTooltipDefaultOptions`. This new property is optional.
As with some existing configurations, if a CSS class is defined directly on the tooltip
component, it will automatically override the default class. Two tests have been created
to ensure the solution works as expected.

Fixes #29355

* feat(material/form-field): replicate tooltipClass to default MatTooltipDefaultOptions

The `tooltipClass` property has been added to the default configuration options in
`MatTooltipDefaultOptions`. This new property is optional.
As with some existing configurations, if a CSS class is defined directly on the tooltip
component, it will automatically override the default class. Two tests have been created
to ensure the solution works as expected.

Fixes #29355
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/tooltip feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
2 participants