Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed calculation that results in NaN #790

Merged
merged 1 commit into from Jun 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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