From de3889e04afbc92f94bcce91728d3bd2c480e102 Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Wed, 22 Jul 2026 15:19:09 +0200 Subject: [PATCH] fix: use aria-current instead of aria-selected on navigation drawer items (#23160) ## Fixes Closes #23129 ## Problem Navigation drawer items render an `` (or React Router `Link`) with `aria-selected="true"`. `aria-selected` is only valid on roles such as `option`, `tab`, `row`, or `gridcell`, not on links, so axe flags WCAG 4.1.2 (aria-allowed-attr): "ARIA attribute is not allowed: aria-selected=true". ## Fix Use `aria-current="page"` instead. It is the WAI-ARIA recommended way to mark the current item in a navigation, it is a global attribute valid on any role (link, button, or div), and it correctly communicates the active page to screen readers. `packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx`: - aria-selected={active} + aria-current={active ? 'page' : undefined} Review in cubic --- .../navigation-drawer/components/NavigationDrawerItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx index c28c959035..147f381d83 100644 --- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx +++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx @@ -330,7 +330,7 @@ export const NavigationDrawerItem = ({ onClick={handleMouseDownNavigationClickClick} onMouseDown={handleMouseDown} active={active} - aria-selected={active} + aria-current={isDefined(to) && active ? 'page' : undefined} isSoon={isSoon} variant={variant} indentationLevel={indentationLevel}