Skip to content

Commit

Permalink
Fixed calculation that results in NaN (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoozbuster authored and FezVrasta committed Jun 16, 2019
1 parent 8f24691 commit 881a29c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/popper/src/utils/getBoundingClientRect.js
Expand Up @@ -44,9 +44,9 @@ export default function getBoundingClientRect(element) {
// subtract scrollbar size from sizes
const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
const width =
sizes.width || element.clientWidth || result.right - result.left;
sizes.width || element.clientWidth || result.width;
const height =
sizes.height || element.clientHeight || result.bottom - result.top;
sizes.height || element.clientHeight || result.height;

let horizScrollbar = element.offsetWidth - width;
let vertScrollbar = element.offsetHeight - height;
Expand Down

0 comments on commit 881a29c

Please sign in to comment.