diff --git a/src/utils/dom/style.ts b/src/utils/dom/style.ts index e5f9b0ac2..0c180497d 100644 --- a/src/utils/dom/style.ts +++ b/src/utils/dom/style.ts @@ -1,7 +1,13 @@ import { unref, Ref } from 'vue'; -export function isHidden(elementRef: HTMLElement | Ref) { +export function isHidden( + elementRef: HTMLElement | Ref +) { const el = unref(elementRef); + if (!el) { + return false; + } + const style = window.getComputedStyle(el); const hidden = style.display === 'none';