This was incorrectly migrated to TypeScript. Before TypeScript this used a
regular `for` loop counting indices, allowing the `return;` to correctly leave
the loop.
see https://www.woltlab.com/community/thread/296198-formbuilder-tabmenuformcontainer-required-js-fehler/
return;
}
- container.querySelectorAll("input, select").forEach((element: HTMLInputElement | HTMLSelectElement) => {
+ for (const element of container.querySelectorAll<HTMLInputElement | HTMLSelectElement>("input, select")) {
if (!element.checkValidity()) {
event.preventDefault();
return;
}
- });
+ }
});
}
}
if (event.defaultPrevented) {
return;
}
- container.querySelectorAll("input, select").forEach((element) => {
+ for (const element of container.querySelectorAll("input, select")) {
if (!element.checkValidity()) {
event.preventDefault();
// Select the tab that contains the erroneous element.
});
return;
}
- });
+ }
});
}
}