react-intersection-observer
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -124,3 +124,7 @@ "use strict"; | ||
if (Array.isArray(_options.threshold)) { | ||
if (isIntersecting !== undefined) { | ||
// If isIntersecting is defined, use it to confirm the intersection. | ||
// Firefox can report a negative intersectionRatio, but it will still have correctly set isIntersecting | ||
_inView = isIntersecting; | ||
} else if (Array.isArray(_options.threshold)) { | ||
// If threshold is an array, check if any of them intersects. This just triggers the onChange event multiple times. | ||
@@ -135,8 +139,2 @@ _inView = _options.threshold.some(function (threshold) { | ||
if (isIntersecting !== undefined) { | ||
// If isIntersecting is defined, ensure that the element is actually intersecting. | ||
// Otherwise it reports a threshold of 0 | ||
_inView = _inView && isIntersecting; | ||
} | ||
// Update the visible value on the instance | ||
@@ -143,0 +141,0 @@ instance.visible = _inView; |
{ | ||
"name": "react-intersection-observer", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API", | ||
@@ -80,3 +80,3 @@ "main": "lib/index.js", | ||
"eslint-config-insilico": "^5.0.1", | ||
"flow-bin": "^0.61.0", | ||
"flow-bin": "^0.62.0", | ||
"flow-copy-source": "^1.2.1", | ||
@@ -83,0 +83,0 @@ "husky": "^0.14.3", |
@@ -127,3 +127,7 @@ // @flow | ||
if (Array.isArray(options.threshold)) { | ||
if (isIntersecting !== undefined) { | ||
// If isIntersecting is defined, use it to confirm the intersection. | ||
// Firefox can report a negative intersectionRatio, but it will still have correctly set isIntersecting | ||
inView = isIntersecting | ||
} else if (Array.isArray(options.threshold)) { | ||
// If threshold is an array, check if any of them intersects. This just triggers the onChange event multiple times. | ||
@@ -142,8 +146,2 @@ inView = options.threshold.some(threshold => { | ||
if (isIntersecting !== undefined) { | ||
// If isIntersecting is defined, ensure that the element is actually intersecting. | ||
// Otherwise it reports a threshold of 0 | ||
inView = inView && isIntersecting | ||
} | ||
// Update the visible value on the instance | ||
@@ -150,0 +148,0 @@ instance.visible = inView |
Sorry, the diff of this file is not supported yet
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
43090
566