We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72d65c1 commit b5f1663Copy full SHA for b5f1663
src/utils.ts
@@ -9,12 +9,12 @@ export function containEl(
9
): boolean {
10
let contain = false;
11
12
- if (parentNode?.childNodes && childrenNode) {
13
- parentNode.childNodes.forEach((i) => {
14
- if (i === childrenNode) {
+ if (parentNode?.childNodes?.length > 0 && childrenNode) {
+ for (let i = 0; i < parentNode.childNodes.length; i++) {
+ if (parentNode.childNodes[i] === childrenNode) {
15
contain = true;
16
}
17
- });
+ }
18
19
20
return contain;
0 commit comments