mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
🔼 a11y: Proper attributes for the side panel toggle button (#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
This commit is contained in:
parent
b939e24f67
commit
262176fec4
1 changed files with 3 additions and 1 deletions
|
|
@ -34,7 +34,9 @@ export default function NavToggle({
|
||||||
>
|
>
|
||||||
<TooltipAnchor
|
<TooltipAnchor
|
||||||
side={side === 'right' ? 'left' : 'right'}
|
side={side === 'right' ? 'left' : 'right'}
|
||||||
aria-label={`toggle-${side === 'left' ? 'chat-history' : 'controls'}-nav`}
|
aria-label={side === 'left' ? localize('com_ui_chat_history') : localize('com_ui_controls')}
|
||||||
|
aria-expanded={navVisible}
|
||||||
|
aria-controls={side === 'left' ? 'chat-history-nav' : 'controls-nav'}
|
||||||
id={`toggle-${side}-nav`}
|
id={`toggle-${side}-nav`}
|
||||||
onClick={onToggle}
|
onClick={onToggle}
|
||||||
role="button"
|
role="button"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue