File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,9 @@ export class Menu implements ComponentInterface, MenuI {
418418 */
419419 @Method ( )
420420 setOpen ( shouldOpen : boolean , animated = true , role ?: string ) : Promise < boolean > {
421+ // Blur the active element to prevent it from being kept focused inside an element that will be set with aria-hidden="true"
422+ ( document . activeElement as HTMLElement ) ?. blur ( ) ;
423+
421424 return menuController . _setOpen ( this , shouldOpen , animated , role ) ;
422425 }
423426
Original file line number Diff line number Diff line change @@ -513,6 +513,7 @@ export const present = async <OverlayPresentOptions>(
513513 return ;
514514 }
515515
516+ // Blur the active element to prevent it from being kept focused inside a container that will be set with aria-hidden="true"
516517 ( document . activeElement as HTMLElement ) ?. blur ( ) ;
517518
518519 /**
@@ -650,6 +651,7 @@ export const dismiss = async <OverlayDismissOptions>(
650651 return false ;
651652 }
652653
654+ // Blur the active element to prevent it from being kept focused inside the overlay, since it will be removed
653655 ( document . activeElement as HTMLElement ) ?. blur ( ) ;
654656
655657 const presentedOverlays = doc !== undefined ? getPresentedOverlays ( doc ) : [ ] ;
You can’t perform that action at this time.
0 commit comments