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 Nov 26, 2016
1 parent b8ade2c commit 630b7fa
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 @@ -119,9 +119,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 630b7fa

Please sign in to comment.