Skip to content

Commit 77e4572

Browse files
committed
fix: Support NodeList entries in domArray helper
1 parent d85239b commit 77e4572

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/util/dom.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
export const domArray = (target, document) => {
66
if (typeof target === 'string') return Array.from(document.querySelectorAll(target))
77
if (target.tagName) return [target]
8-
if (target.jquery) return target.toArray()
98
if (Array.isArray(target)) return target
10-
return []
9+
// Support NodeList and jQuery arrays
10+
return Array.from(target)
1111
}
1212

1313
/**
@@ -18,6 +18,7 @@ export const domArray = (target, document) => {
1818
export const domSelector = (target, document) => {
1919
if (typeof target === 'string') return document.querySelector(target)
2020
if (target.tagName) return target
21-
if (target.jquery) return target[0]
21+
// Support NodeList and jQuery arrays
22+
if (target[0]) return target[0]
2223
return target
2324
}

0 commit comments

Comments
 (0)