aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-09-08 18:17:08 +0800
committerGitHub <noreply@github.com>2023-09-08 18:17:08 +0800
commit80d14b8f4af09f46faece0ffa66818fc2697bb27 (patch)
tree1662302f216541a0dbff1f03dc87060df601a064
parent4e240f2304d9d18dadd47a8c578dd46847f7a595 (diff)
downloadgitea-80d14b8f4af09f46faece0ffa66818fc2697bb27.tar.gz
gitea-80d14b8f4af09f46faece0ffa66818fc2697bb27.zip
Check newly added node type before "attachDirAuto" (#26972)
-rw-r--r--web_src/js/modules/dirauto.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/web_src/js/modules/dirauto.js b/web_src/js/modules/dirauto.js
index 91f71a5b85..c917bf8cff 100644
--- a/web_src/js/modules/dirauto.js
+++ b/web_src/js/modules/dirauto.js
@@ -19,7 +19,7 @@ export function initDirAuto() {
for (let i = 0; i < len; i++) {
const addedNode = mutation.addedNodes[i];
if (addedNode.nodeType !== Node.ELEMENT_NODE && addedNode.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) continue;
- attachDirAuto(addedNode);
+ if (addedNode.nodeName === 'INPUT' || addedNode.nodeName === 'TEXTAREA') attachDirAuto(addedNode);
const children = addedNode.querySelectorAll('input, textarea');
const len = children.length;
for (let childIdx = 0; childIdx < len; childIdx++) {