Skip to content

Commit 8720715

Browse files
committed
fix(tabs): only use aria-current on active links
We previously set `aria-current` to either "true" or "false" for each `matTabLink`. This change now only applies the attribute to the active tab, omitting it for inactive tabs. Additionally, instead of setting true, we now set the attribute to "page", which specifically indicates that the item is a link that refers to the current page. Fixes #16557
1 parent 036729d commit 8720715

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/material/tabs/tab-nav-bar/tab-nav-bar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const _MatTabLinkMixinBase:
168168
inputs: ['disabled', 'disableRipple', 'tabIndex'],
169169
host: {
170170
'class': 'mat-tab-link',
171-
'[attr.aria-current]': 'active',
171+
'[attr.aria-current]': 'active ? "page" : null',
172172
'[attr.aria-disabled]': 'disabled',
173173
'[attr.tabIndex]': 'tabIndex',
174174
'[class.mat-tab-disabled]': 'disabled',

0 commit comments

Comments
 (0)