@superdispatch/ui 0.24.8 → 0.24.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,7 +21,7 @@ export function useVisibilityObserver(node) {
|
|
|
21
21
|
|
|
22
22
|
var observer = new IntersectionObserver(_ref => {
|
|
23
23
|
var [entry] = _ref;
|
|
24
|
-
setState(entry !== null && entry !== void 0 && entry.isIntersecting ? 'visible' : 'invisible');
|
|
24
|
+
setState(entry !== null && entry !== void 0 && entry.isIntersecting && document.visibilityState === 'visible' ? 'visible' : 'invisible');
|
|
25
25
|
}, {
|
|
26
26
|
rootMargin,
|
|
27
27
|
threshold
|
package/dist-web/index.js
CHANGED
|
@@ -1114,7 +1114,7 @@ function useVisibilityObserver(node) {
|
|
|
1114
1114
|
|
|
1115
1115
|
var observer = new IntersectionObserver(_ref => {
|
|
1116
1116
|
var [entry] = _ref;
|
|
1117
|
-
setState(entry !== null && entry !== void 0 && entry.isIntersecting ? 'visible' : 'invisible');
|
|
1117
|
+
setState(entry !== null && entry !== void 0 && entry.isIntersecting && document.visibilityState === 'visible' ? 'visible' : 'invisible');
|
|
1118
1118
|
}, {
|
|
1119
1119
|
rootMargin,
|
|
1120
1120
|
threshold
|