@@ -636,21 +636,21 @@ export class MDCMenuSurfaceFoundation extends
636
636
* closed.
637
637
*/
638
638
private maybeRestoreFocus ( ) {
639
- const isRootFocused = this . adapter . isFocused ( ) ;
640
- const ownerDocument = this . adapter . getOwnerDocument ?
641
- this . adapter . getOwnerDocument ( ) :
642
- document ;
643
- const childHasFocus = ownerDocument . activeElement &&
644
- this . adapter . isElementInContainer ( ownerDocument . activeElement ) ;
645
- if ( isRootFocused || childHasFocus ) {
646
- // Wait before restoring focus when closing the menu surface. This is
647
- // important because if a touch event triggered the menu close, and the
648
- // subsequent mouse event occurs after focus is restored, then the
649
- // restored focus would be lost.
650
- setTimeout ( ( ) => {
639
+ // Wait before restoring focus when closing the menu surface. This is
640
+ // important because if a touch event triggered the menu close, and the
641
+ // subsequent mouse event occurs after focus is restored, then the
642
+ // restored focus would be lost.
643
+ setTimeout ( ( ) => {
644
+ const isRootFocused = this . adapter . isFocused ( ) ;
645
+ const ownerDocument = this . adapter . getOwnerDocument ?
646
+ this . adapter . getOwnerDocument ( ) :
647
+ document ;
648
+ const childHasFocus = ownerDocument . activeElement &&
649
+ this . adapter . isElementInContainer ( ownerDocument . activeElement ) ;
650
+ if ( isRootFocused || childHasFocus ) {
651
651
this . adapter . restoreFocus ( ) ;
652
- } , numbers . TOUCH_EVENT_WAIT_MS ) ;
653
- }
652
+ }
653
+ } , numbers . TOUCH_EVENT_WAIT_MS ) ;
654
654
}
655
655
656
656
private hasBit ( corner : Corner , bit : CornerBit ) : boolean {
0 commit comments