Skip to content

fix(multiple): use DI token for tag name #30892

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

crisbeto
Copy link
Member

Reads the tag name through DI, instead of going through the DOM which should be more SSR-friendly.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Apr 17, 2025
@crisbeto crisbeto requested a review from a team as a code owner April 17, 2025 07:07
@crisbeto crisbeto requested review from mmalerba and wagnermaciel and removed request for a team April 17, 2025 07:07
Reads the tag name through DI, instead of going through the DOM which should be more SSR-friendly.
// Heads-up for developers to avoid putting matBadge on <mat-icon>
// as it is aria-hidden by default docs mention this at:
// https://material.angular.io/components/badge/overview#accessibility
if (
nativeElement.tagName.toLowerCase() === 'mat-icon' &&
tagName.toLowerCase() === 'mat-icon' &&
nativeElement.getAttribute('aria-hidden') === 'true'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this always return false in SSR because of this nativeElement.getAttribute check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah getAttribute works during SSR.

@crisbeto crisbeto removed the request for review from mmalerba April 17, 2025 19:27
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Apr 17, 2025
@crisbeto crisbeto merged commit 48894ad into angular:main Apr 17, 2025
26 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants