Handle invalid `<textarea>` elements when submitting a form within a TabMenu
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 5 Jul 2022 08:37:50 +0000 (10:37 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 5 Jul 2022 08:37:50 +0000 (10:37 +0200)
ts/WoltLabSuite/Core/Ui/TabMenu.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu.js

index d4893bfdfcaf5986119eaefdd25465018252ce6a..24c5291d0052e6753e4b30832baec2beb0e45efd 100644 (file)
@@ -95,7 +95,9 @@ function init() {
             return;
           }
 
-          for (const element of container.querySelectorAll<HTMLInputElement | HTMLSelectElement>("input, select")) {
+          for (const element of container.querySelectorAll<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>(
+            "input, select, textarea",
+          )) {
             if (!element.checkValidity()) {
               event.preventDefault();
 
index 5b9f0f0c3ec2920a18c9cbdaa05af1380cb7e134..1dd751cd00dc814bec37747f49743d0076206331 100644 (file)
@@ -84,7 +84,7 @@ define(["require", "exports", "tslib", "../Dom/Change/Listener", "../Dom/Util",
                         if (event.defaultPrevented) {
                             return;
                         }
-                        for (const element of container.querySelectorAll("input, select")) {
+                        for (const element of container.querySelectorAll("input, select, textarea")) {
                             if (!element.checkValidity()) {
                                 event.preventDefault();
                                 // Select the tab that contains the erroneous element.