mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-09 11:21:19 +01:00
Check newly added node type before "attachDirAuto" (#26972)
This commit is contained in:
parent
4e240f2304
commit
80d14b8f4a
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ export function initDirAuto() {
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
const addedNode = mutation.addedNodes[i];
|
const addedNode = mutation.addedNodes[i];
|
||||||
if (addedNode.nodeType !== Node.ELEMENT_NODE && addedNode.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) continue;
|
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 children = addedNode.querySelectorAll('input, textarea');
|
||||||
const len = children.length;
|
const len = children.length;
|
||||||
for (let childIdx = 0; childIdx < len; childIdx++) {
|
for (let childIdx = 0; childIdx < len; childIdx++) {
|
||||||
|
|
Loading…
Reference in a new issue