Skip to content

Commit 80d14b8

Browse files
authored
Check newly added node type before "attachDirAuto" (#26972)
1 parent 4e240f2 commit 80d14b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/modules/dirauto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function initDirAuto() {
1919
for (let i = 0; i < len; i++) {
2020
const addedNode = mutation.addedNodes[i];
2121
if (addedNode.nodeType !== Node.ELEMENT_NODE && addedNode.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) continue;
22-
attachDirAuto(addedNode);
22+
if (addedNode.nodeName === 'INPUT' || addedNode.nodeName === 'TEXTAREA') attachDirAuto(addedNode);
2323
const children = addedNode.querySelectorAll('input, textarea');
2424
const len = children.length;
2525
for (let childIdx = 0; childIdx < len; childIdx++) {

0 commit comments

Comments
 (0)