Skip to content

Commit 24802a2

Browse files
committed
fix: selector bug when element type is not present
The commit fixes a bug where the selector was not properly defined when the element type was not present, resulting in incorrect attribute checking.
1 parent 261170b commit 24802a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@
234234

235235
for (let i = 0; i < type.length; i++) {
236236
let Selector = selector
237-
if (!Selector) {
237+
if (!Selector && element.nodeType !== 9) {
238+
238239
let name = prefix + '-' + type[i]
239240
if (!element.hasAttribute(name))
240241
continue

0 commit comments

Comments
 (0)