diff --git a/src/core/singletons/dom.ts b/src/core/singletons/dom.ts index a969e6463..eb3798944 100644 --- a/src/core/singletons/dom.ts +++ b/src/core/singletons/dom.ts @@ -123,8 +123,12 @@ export class CoreDom { * @returns True if element is visible inside the DOM. */ static isElementVisible(element: HTMLElement, checkSize = true): boolean { - if (checkSize && (element.clientWidth === 0 || element.clientHeight === 0)) { - return false; + if (checkSize) { + const dimensions = element.getBoundingClientRect(); + + if (dimensions.width === 0 || dimensions.height === 0) { + return false; + } } const style = getComputedStyle(element);