Skip to content

Commit

Permalink
Ensure getSize always returns a number
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Harper committed Jul 28, 2015
1 parent e63655f commit c8d9a33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/domUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ function getPosition(elem, offsetParent) {
*/
function getSize(elem) {
let rect = {
width: elem.offsetWidth,
height: elem.offsetHeight
width: elem.offsetWidth || 0,
height: elem.offsetHeight || 0
};
if (typeof elem.getBoundingClientRect !== 'undefined') {
let {width, height} = elem.getBoundingClientRect();
Expand Down

0 comments on commit c8d9a33

Please sign in to comment.