Skip to content

Commit 04dfc52

Browse files
committed
fix(material/badge): remove the console warning
removes the console.warn when badge is used with aria hidden `mat-icon` fixes #27796
1 parent ff3d342 commit 04dfc52

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/material/badge/badge.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,6 @@ export class MatBadge implements OnInit, OnDestroy {
164164
if (nativeElement.nodeType !== nativeElement.ELEMENT_NODE) {
165165
throw Error('matBadge must be attached to an element node.');
166166
}
167-
168-
// Heads-up for developers to avoid putting matBadge on <mat-icon>
169-
// as it is aria-hidden by default docs mention this at:
170-
// https://material.angular.io/components/badge/overview#accessibility
171-
if (
172-
nativeElement.tagName.toLowerCase() === 'mat-icon' &&
173-
nativeElement.getAttribute('aria-hidden') === 'true'
174-
) {
175-
console.warn(
176-
`Detected a matBadge on an "aria-hidden" "<mat-icon>". ` +
177-
`Consider setting aria-hidden="false" in order to surface the information assistive technology.` +
178-
`\n${nativeElement.outerHTML}`,
179-
);
180-
}
181167
}
182168
}
183169

0 commit comments

Comments
 (0)