Skip to content

Commit 27467e2

Browse files
🔼 a11y: Proper attributes for the side panel toggle button (danny-avila#4559)
- added aria-expanded attribute to indicate the panel's expanded/collapsed state - added aria-controls attribute to specify the element controlled by the button - updated aria-label using the localize function for better description
1 parent b60f1d8 commit 27467e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client/src/components/Nav/NavToggle.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export default function NavToggle({
3434
>
3535
<TooltipAnchor
3636
side={side === 'right' ? 'left' : 'right'}
37-
aria-label={`toggle-${side === 'left' ? 'chat-history' : 'controls'}-nav`}
37+
aria-label={side === 'left' ? localize('com_ui_chat_history') : localize('com_ui_controls')}
38+
aria-expanded={navVisible}
39+
aria-controls={side === 'left' ? 'chat-history-nav' : 'controls-nav'}
3840
id={`toggle-${side}-nav`}
3941
onClick={onToggle}
4042
role="button"

0 commit comments

Comments
 (0)