@reach/popover
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -56,4 +56,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
return { | ||
left: directionRight ? targetRect.right - popupRect.width + window.scrollX + "px" : targetRect.left + window.scrollX + "px", | ||
top: directionUp ? targetRect.top - popupRect.height + window.scrollY + "px" : targetRect.top + targetRect.height + window.scrollY + "px" | ||
left: directionRight ? targetRect.right - popupRect.width + window.pageXOffset + "px" : targetRect.left + window.pageXOffset + "px", | ||
top: directionUp ? targetRect.top - popupRect.height + window.pageYOffset + "px" : targetRect.top + targetRect.height + window.pageYOffset + "px" | ||
}; | ||
@@ -69,3 +69,3 @@ } | ||
left: targetRect.left, | ||
top: directionUp ? targetRect.top - popupRect.height + window.scrollY + "px" : targetRect.top + targetRect.height + window.scrollY + "px" | ||
top: directionUp ? targetRect.top - popupRect.height + window.pageYOffset + "px" : targetRect.top + targetRect.height + window.pageYOffset + "px" | ||
}; | ||
@@ -88,3 +88,3 @@ } | ||
// left: collisions.right | ||
// ? `${targetRect.right - popupRect.width + window.scrollX}px` | ||
// ? `${targetRect.right - popupRect.width + window.pageXOffset}px` | ||
// : collisions.left ? `` : `` | ||
@@ -91,0 +91,0 @@ // }; |
@@ -73,4 +73,4 @@ "use strict"; | ||
return { | ||
left: directionRight ? targetRect.right - popupRect.width + window.scrollX + "px" : targetRect.left + window.scrollX + "px", | ||
top: directionUp ? targetRect.top - popupRect.height + window.scrollY + "px" : targetRect.top + targetRect.height + window.scrollY + "px" | ||
left: directionRight ? targetRect.right - popupRect.width + window.pageXOffset + "px" : targetRect.left + window.pageXOffset + "px", | ||
top: directionUp ? targetRect.top - popupRect.height + window.pageYOffset + "px" : targetRect.top + targetRect.height + window.pageYOffset + "px" | ||
}; | ||
@@ -86,3 +86,3 @@ } | ||
left: targetRect.left, | ||
top: directionUp ? targetRect.top - popupRect.height + window.scrollY + "px" : targetRect.top + targetRect.height + window.scrollY + "px" | ||
top: directionUp ? targetRect.top - popupRect.height + window.pageYOffset + "px" : targetRect.top + targetRect.height + window.pageYOffset + "px" | ||
}; | ||
@@ -105,3 +105,3 @@ } | ||
// left: collisions.right | ||
// ? `${targetRect.right - popupRect.width + window.scrollX}px` | ||
// ? `${targetRect.right - popupRect.width + window.pageXOffset}px` | ||
// : collisions.left ? `` : `` | ||
@@ -108,0 +108,0 @@ // }; |
{ | ||
"name": "@reach/popover", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Render a portal positioned relative to another element.", | ||
@@ -15,3 +15,3 @@ "main": "index.js", | ||
"@reach/rect": "^0.2.1", | ||
"@reach/utils": "^0.2.2" | ||
"@reach/utils": "^0.2.3" | ||
}, | ||
@@ -18,0 +18,0 @@ "peerDependencies": { |
@@ -52,7 +52,7 @@ import React, { useRef, forwardRef } from "react"; | ||
left: directionRight | ||
? `${targetRect.right - popupRect.width + window.scrollX}px` | ||
: `${targetRect.left + window.scrollX}px`, | ||
? `${targetRect.right - popupRect.width + window.pageXOffset}px` | ||
: `${targetRect.left + window.pageXOffset}px`, | ||
top: directionUp | ||
? `${targetRect.top - popupRect.height + window.scrollY}px` | ||
: `${targetRect.top + targetRect.height + window.scrollY}px` | ||
? `${targetRect.top - popupRect.height + window.pageYOffset}px` | ||
: `${targetRect.top + targetRect.height + window.pageYOffset}px` | ||
}; | ||
@@ -67,4 +67,4 @@ } | ||
top: directionUp | ||
? `${targetRect.top - popupRect.height + window.scrollY}px` | ||
: `${targetRect.top + targetRect.height + window.scrollY}px` | ||
? `${targetRect.top - popupRect.height + window.pageYOffset}px` | ||
: `${targetRect.top + targetRect.height + window.pageYOffset}px` | ||
}; | ||
@@ -87,3 +87,3 @@ } | ||
// left: collisions.right | ||
// ? `${targetRect.right - popupRect.width + window.scrollX}px` | ||
// ? `${targetRect.right - popupRect.width + window.pageXOffset}px` | ||
// : collisions.left ? `` : `` | ||
@@ -90,0 +90,0 @@ // }; |
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
12484
Updated@reach/utils@^0.2.3