Skip to content

Commit a62219f

Browse files
committed
Fix test exceptions on IE.
1 parent 801d45a commit a62219f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/dialog/dialog-container.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class MdDialogContainer extends BasePortalHost implements OnDestroy {
5959
@ViewChild(FocusTrap) _focusTrap: FocusTrap;
6060

6161
/** Element that was focused before the dialog was opened. Save this to restore upon close. */
62-
private _elementFocusedBeforeDialogWasOpened: Element = null;
62+
private _elementFocusedBeforeDialogWasOpened: HTMLElement = null;
6363

6464
/** The dialog configuration. */
6565
dialogConfig: MdDialogConfig;
@@ -89,7 +89,7 @@ export class MdDialogContainer extends BasePortalHost implements OnDestroy {
8989
// ready in instances where change detection has to run first. To deal with this, we simply
9090
// wait for the microtask queue to be empty.
9191
this._ngZone.onMicrotaskEmpty.first().subscribe(() => {
92-
this._elementFocusedBeforeDialogWasOpened = document.activeElement;
92+
this._elementFocusedBeforeDialogWasOpened = document.activeElement as HTMLElement;
9393
this._focusTrap.focusFirstTabbableElement();
9494
});
9595

@@ -113,6 +113,7 @@ export class MdDialogContainer extends BasePortalHost implements OnDestroy {
113113
if (toFocus && 'focus' in toFocus) {
114114
toFocus.focus();
115115
}
116+
116117
this._onAnimationStateChange.complete();
117118
});
118119
}

0 commit comments

Comments
 (0)