Skip to content

Commit

Permalink
Added undefined check and fallback on startContainer.getBoundingClien…
Browse files Browse the repository at this point in the history
…tRect
  • Loading branch information
flipflopsandrice committed Jul 4, 2017
1 parent 4ba4fff commit 054cf97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/extensions/paste.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@
// on empty line, rects is empty so we grab information from the first container of the range
if (rects.length) {
top += rects[0].top;
} else {
} else if (range.startContainer.getBoundingClientRect !== undefined) {
top += range.startContainer.getBoundingClientRect().top;
} else {
top += range.getBoundingClientRect().top;
}
}

Expand Down

0 comments on commit 054cf97

Please sign in to comment.