Skip to content

Commit

Permalink
fix: test failures in IE and blur element if there's no focusable tri…
Browse files Browse the repository at this point in the history
…gger
  • Loading branch information
crisbeto committed Dec 2, 2016
1 parent 7638343 commit 2d47439
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/sidenav/sidenav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@ export class MdSidenav implements AfterContentInit {
});

this.onClose.subscribe(() => {
if (this._elementFocusedBeforeSidenavWasOpened) {
if (this._elementFocusedBeforeSidenavWasOpened instanceof HTMLElement) {
this._elementFocusedBeforeSidenavWasOpened.focus();
} else {
this._elementRef.nativeElement.blur();
}

this._elementFocusedBeforeSidenavWasOpened = null;
});
}

Expand Down

0 comments on commit 2d47439

Please sign in to comment.