better visible check

This commit is contained in:
Miodec 2023-03-01 00:07:52 +01:00
parent a98d658fe9
commit 1501b28f2c

View file

@ -1195,12 +1195,12 @@ export function createErrorMessage(error: unknown, message: string): string {
}
export function isElementVisible(query: string): boolean {
const popup = document.querySelector(query);
if (!popup) {
const el = document.querySelector(query);
if (!el) {
return false;
}
const style = window.getComputedStyle(popup);
return style.display !== "none";
// const style = window.getComputedStyle(el);
return !!el.getClientRects().length;
}
export function isPopupVisible(popupId: string): boolean {