✨(frontend) fix toggle panel button a11y with dynamic label
improves screen sr by updating label and state indication dynamically Signed-off-by: Cyril <c.gromoff@gmail.com>
This commit is contained in:
@@ -12,12 +12,16 @@ export const ButtonTogglePanel = () => {
|
||||
<Button
|
||||
size="medium"
|
||||
onClick={() => togglePanel()}
|
||||
aria-label={t('Open the header menu')}
|
||||
aria-label={t(
|
||||
isPanelOpen ? 'Close the header menu' : 'Open the header menu',
|
||||
)}
|
||||
aria-expanded={isPanelOpen}
|
||||
variant="tertiary"
|
||||
icon={
|
||||
<Icon $withThemeInherited iconName={isPanelOpen ? 'close' : 'menu'} />
|
||||
}
|
||||
className="--docs--button-toggle-panel"
|
||||
data-testid="header-menu-toggle"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user