Added a screen reader announcement for menu shortcut (#2355)
Co-authored-by: Federico Bernal <64086728+FedericoBernal@users.noreply.github.com>
This commit is contained in:
Родитель
c95dbd1183
Коммит
25cc041b95
|
@ -54,7 +54,7 @@ describe('<MenuItem />', () => {
|
|||
expect(instance).toBeTruthy();
|
||||
expect(wrapper.html().includes('Fullscreen')).toBe(true);
|
||||
expect(wrapper.html().includes('F11')).toBe(true);
|
||||
expect(outerLiElement.getAttribute('aria-label')).toBe('Fullscreen checked');
|
||||
expect(outerLiElement.getAttribute('aria-label')).toBe('FullscreenF11 checked');
|
||||
});
|
||||
|
||||
it('should render a disabled menu item without any errors', () => {
|
||||
|
|
|
@ -64,7 +64,9 @@ export class MenuItemComp extends React.Component<MenuItemProps, Record<string,
|
|||
default:
|
||||
return (
|
||||
<li
|
||||
aria-label={`${label}${disabled ? ' unavailable' : ''}${checked ? ' checked' : ''}`}
|
||||
aria-label={`${label}${subtext ? subtext : ''}${disabled ? ' unavailable' : ''}${
|
||||
checked ? ' checked' : ''
|
||||
}`}
|
||||
className={`${styles.menuItem} ${disabled ? styles.disabled : ''}`}
|
||||
onClick={this.onClick}
|
||||
onKeyDown={this.onKeyDown}
|
||||
|
|
Загрузка…
Ссылка в новой задаче