@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.cjs.js
CHANGED
|
@@ -24494,10 +24494,12 @@ var useCheckElementsInViewport = function useCheckElementsInViewport() {
|
|
|
24494
24494
|
var viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
24495
24495
|
React.useEffect(function () {
|
|
24496
24496
|
elements.forEach(function (element) {
|
|
24497
|
+
console.log("element is", element);
|
|
24497
24498
|
var domEl = document.querySelector(element);
|
|
24498
|
-
|
|
24499
|
+
console.log("domEl is", domEl);
|
|
24500
|
+
var boundingBox = domEl === null || domEl === void 0 ? void 0 : domEl.getBoundingClientRect();
|
|
24499
24501
|
|
|
24500
|
-
if (boundingBox.top >= 0 && boundingBox.left >= 0 && boundingBox.right <= viewportWidth && boundingBox.bottom <= viewportHeight) {
|
|
24502
|
+
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) {
|
|
24501
24503
|
setElementsVisible(true);
|
|
24502
24504
|
}
|
|
24503
24505
|
});
|