react-relative-portal
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -43,2 +43,9 @@ 'use strict'; | ||
function getPageOffset() { | ||
return { | ||
x: window.pageXOffset !== undefined ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft, | ||
y: window.pageYOffset !== undefined ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop | ||
}; | ||
} | ||
if (_exenv.canUseDOM) { | ||
@@ -88,5 +95,6 @@ document.body.addEventListener('mousewheel', (0, _debounce2.default)(fireListeners, 100, true)); | ||
var rect = _this2.element.getBoundingClientRect(); | ||
var top = window.scrollY + rect.top; | ||
var right = window.innerWidth - rect.right + window.scrollX; | ||
var left = window.scrollX + rect.left; | ||
var pageOffset = getPageOffset(); | ||
var top = pageOffset.y + rect.top; | ||
var right = window.innerWidth - rect.right + pageOffset.x; | ||
var left = pageOffset.x + rect.left; | ||
@@ -93,0 +101,0 @@ if (top !== _this2.state.top || left !== _this2.state.left || right !== _this2.state.right) { |
{ | ||
"name": "react-relative-portal", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "React component for place dropdowns outside overflow: hidden; elements", | ||
@@ -5,0 +5,0 @@ "main": "dist/RelativePortal.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17126
236