Skip to content

Commit

Permalink
fix(browser_adapter): element.getBoundingClientRect fails when elemen…
Browse files Browse the repository at this point in the history
…t not in DOM (IE11)
  • Loading branch information
marclaval committed May 22, 2015
1 parent a393f84 commit f35dbb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/angular2/src/dom/browser_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ defaultDoc() {
return document;
}
getBoundingClientRect(el) {
return el.getBoundingClientRect();
try {
return el.getBoundingClientRect();
} catch (e) {
return {top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0};
}
}
getTitle(): string {
return document.title;
Expand Down

0 comments on commit f35dbb9

Please sign in to comment.