File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -502,7 +502,15 @@ describe("Menu interaction", () => {
502502 . shadow ( )
503503 . find ( "li" )
504504 . should ( "have.attr" , "role" , "menuitem" )
505- . and ( "have.attr" , "aria-haspopup" , "menu" ) ;
505+ . and ( "have.attr" , "aria-haspopup" , "menu" )
506+ . and ( "have.attr" , "aria-expanded" , "false" ) ;
507+
508+ cy . get ( "@items" )
509+ . eq ( 0 )
510+ . ui5MenuItemClick ( )
511+ . shadow ( )
512+ . find ( "li" )
513+ . should ( "have.attr" , "aria-expanded" , "true" ) ;
506514
507515 cy . get ( "@items" )
508516 . eq ( 1 )
Original file line number Diff line number Diff line change @@ -385,11 +385,13 @@ class MenuItem extends ListItem implements IMenuItem {
385385 role : AriaRole ;
386386 ariaHaspopup ?: `${AriaHasPopup } `;
387387 ariaKeyShortcuts ?: string ;
388+ ariaExpanded ?: boolean ;
388389 ariaHidden ?: boolean ;
389390 } = {
390391 role : this . accessibilityAttributes . role || "menuitem" ,
391392 ariaHaspopup : this . hasSubmenu ? "menu" : undefined ,
392393 ariaKeyShortcuts : this . accessibilityAttributes . ariaKeyShortcuts ,
394+ ariaExpanded : this . hasSubmenu ? this . isSubMenuOpen : undefined ,
393395 ariaHidden : ! ! this . additionalText && ! ! this . accessibilityAttributes . ariaKeyShortcuts ? true : undefined ,
394396 } ;
395397
You can’t perform that action at this time.
0 commit comments