We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad71f9d commit 4cd7454Copy full SHA for 4cd7454
1 file changed
lib/core/utils/get-ancestry.js
@@ -3,6 +3,7 @@ import getShadowSelector from './get-shadow-selector';
3
function generateAncestry(node) {
4
const nodeName = node.nodeName.toLowerCase();
5
const parentElement = node.parentElement;
6
+ // eslint-disable-next-line no-unused-vars
7
const parentNode = node.parentNode;
8
9
let nthChild = '';
@@ -31,7 +32,7 @@ function generateAncestry(node) {
31
32
}
33
nthChild = count > 1 ? `:nth-child(${index})` : '';
34
} else {
- index = Array.prototype.indexOf.call(parentNode.children, node) + 1;
35
+ index = Array.prototype.indexOf.call(parentElement.children, node) + 1;
36
nthChild = `:nth-child(${index})`;
37
38
0 commit comments