@dreamworld/web-util
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "@dreamworld/web-util", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,3 +14,14 @@ | ||
const elementRect = element.getBoundingClientRect(); | ||
if (elementRect.top < (scrollElementRect.top + offsetTop) || elementRect.bottom > (scrollElementRect.bottom - offsetBottom)) { | ||
let scrollElementTop = scrollElementRect.top; | ||
let scrollElementBottom = scrollElementRect.bottom; | ||
//If given scrolling element as a document scroll | ||
//Document it-self hide from view-port, so this logic is written. | ||
if(document.scrollingElement === scrollElement) { | ||
scrollElementTop = 0; | ||
scrollElementBottom = window.innerHeight; | ||
} | ||
if (elementRect.top < (scrollElementTop + offsetTop) || elementRect.bottom > (scrollElementBottom - offsetBottom)) { | ||
return false; | ||
@@ -17,0 +28,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
14008
262