Mis-nesting of aria roles on sidebar navigation (#2050)

This commit is contained in:
Ryan Garrett 2022-06-20 11:30:25 +01:00 committed by GitHub
parent 01ffff7f15
commit 7ca10daf12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ describe('Search', () => {
getSearchInput().type('{enter}', { force: true });
cy.contains('[role=navigation] [role=menuitem]', 'Introduction').should('have.class', 'active');
cy.contains('[role=menu] [role=menuitem]', 'Introduction').should('have.class', 'active');
});
it('should mark search results', () => {

View File

@ -26,7 +26,7 @@ export class MenuItems extends React.Component<MenuItemsProps> {
className={className}
style={this.props.style}
expanded={expanded}
{...(root ? { role: 'navigation' } : {})}
{...(root ? { role: 'menu' } : {})}
>
{items.map((item, idx) => (
<MenuItem key={idx} item={item} onActivate={this.props.onActivate} />