mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-04 02:34:43 +08:00
better visible check
This commit is contained in:
parent
a98d658fe9
commit
1501b28f2c
1 changed files with 4 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue