diff --git a/src/core/utils.ts b/src/core/utils.ts index 809ad64..0c7457a 100644 --- a/src/core/utils.ts +++ b/src/core/utils.ts @@ -63,11 +63,13 @@ export function elems( ? elements : typeof elements === 'string' ? toArray(wrapper.querySelectorAll(elements)) - : elements instanceof HTMLElement - ? [elements] - : elements instanceof NodeList - ? toArray(elements) - : [] + : elements instanceof HTMLElement || + elements instanceof elements.ownerDocument.defaultView.HTMLElement + ? [elements] + : elements instanceof NodeList || + elements instanceof elements.ownerDocument.defaultView.NodeList + ? toArray(elements) + : [] } export function prevent(e: any): void {