@thecb/components 7.7.8-beta.5 → 7.7.8-beta.6
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.
package/dist/index.esm.js
CHANGED
|
@@ -24486,10 +24486,12 @@ var useCheckElementsInViewport = function useCheckElementsInViewport() {
|
|
|
24486
24486
|
var viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
24487
24487
|
useEffect$1(function () {
|
|
24488
24488
|
elements.forEach(function (element) {
|
|
24489
|
+
console.log("element is", element);
|
|
24489
24490
|
var domEl = document.querySelector(element);
|
|
24490
|
-
|
|
24491
|
+
console.log("domEl is", domEl);
|
|
24492
|
+
var boundingBox = domEl === null || domEl === void 0 ? void 0 : domEl.getBoundingClientRect();
|
|
24491
24493
|
|
|
24492
|
-
if (boundingBox.top >= 0 && boundingBox.left >= 0 && boundingBox.right <= viewportWidth && boundingBox.bottom <= viewportHeight) {
|
|
24494
|
+
if ((boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.top) >= 0 && (boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.left) >= 0 && (boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.right) <= viewportWidth && (boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.bottom) <= viewportHeight) {
|
|
24493
24495
|
setElementsVisible(true);
|
|
24494
24496
|
}
|
|
24495
24497
|
});
|