Skip to content

Commit

Permalink
remove aria-label from AnchorNav toggle button in favour of visually-…
Browse files Browse the repository at this point in the history
…hidden text
  • Loading branch information
joshfarrant committed Nov 29, 2024
1 parent 0f8bfa6 commit a74b2be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/AnchorNav/AnchorNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,16 @@ function _AnchorNav({children, enableDefaultBgColor = false, hideUntilSticky = f
<button
onClick={handleMenuToggle}
className={clsx(styles['AnchorNav-menu-button'])}
aria-expanded={menuOpen ? 'true' : 'false'}
aria-expanded={menuOpen}
aria-controls={idForLinkContainer}
aria-label={`${menuOpen ? 'close' : 'open'} anchor navigation menu`}
data-testid={testIds.menuButton}
>
{menuOpen ? (
<ChevronUpIcon size={16} className={styles['AnchorNav-menu-button-arrow']} fill="currentcolor" />
) : (
<ChevronDownIcon size={16} className={styles['AnchorNav-menu-button-arrow']} fill="currentcolor" />
)}
<span className="visually-hidden">Anchor navigation menu. Currently selected:</span>{' '}
<Text as="span" className={clsx(styles['AnchorNav-link-label'])}>
{currentActiveNavItem}
</Text>
Expand Down

0 comments on commit a74b2be

Please sign in to comment.