From 7eb9b9ed1a77f808467b6fe1c0e86170ad97f79b Mon Sep 17 00:00:00 2001 From: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:41:04 +0200 Subject: [PATCH] [JENKINS-71252][JENKINS-70793] Multiple form validation fixes (#8422) * [JENKINS-71252] Show form validation for hidden elements * [JENKINS-70793] Clear all validation output on update --------- Co-authored-by: Daniel Beck (cherry picked from commit 012fa004515ec9f925fb022ddff9a4a7f2e3491b) --- war/src/main/webapp/scripts/hudson-behavior.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index cd35a3cd6032..7284a14e2ba1 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -639,17 +639,7 @@ function updateValidationArea(validationArea, content) { // Only change content if different, causes an unnecessary animation otherwise if (validationArea.innerHTML !== content) { validationArea.innerHTML = content; - validationArea.style.height = - validationArea.children[0].offsetHeight + "px"; - - // Only include the notice in the validation-error-area, move all other elements out - if (validationArea.children.length > 1) { - Array.from(validationArea.children) - .slice(1) - .forEach((element) => { - validationArea.after(element); - }); - } + validationArea.style.height = "auto"; Behaviour.applySubtree(validationArea); // For errors with additional details, apply the subtree to the expandable details pane