You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(badge): put matBadgeDescription on host instead of badge element
Fixes a screenreader issue on the mat-badge component where
screenreaders did not read the `matBadgeDescription` for badges hosted
on `button` elements.
Example:
```<button mat-badge="2" matBadgeDescription="2 unread messages">open
messages</button>```
As tested on Chromevox with Chrome browser, screenreader reads "open
messages" and does *not* read "2 unread messages". Screenreader does not
allow navigation to the badge element.
This happens because `button`'s are not supposed to have multiple lines.
Solution is to align with tooltip by making the badge element
aria-hidden and applying the `matBadgeDescription` to the host element.
0 commit comments