Skip to content

Commit

Permalink
fix: getDomQueryPath hasAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
betterRunner committed Sep 27, 2021
1 parent 240c62b commit d35add2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function getDomQueryPath(el: HTMLElement) {
}
}
const name = el.nodeName.toLowerCase();
if (el.hasAttribute("id") && el.id != "") {
if (typeof el.hasAttribute === 'function' && el.hasAttribute("id") && el.id != "") {
stack.unshift(`${name}#${el.id}`);
} else if (sibCount > 1) {
stack.unshift(`${name}:nth-of-type(${sibIndex + 1})`);
Expand Down

0 comments on commit d35add2

Please sign in to comment.