]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Update foundation.abide.js 12586/head
authorasineath-onpoint <145380373+asineath-onpoint@users.noreply.github.com>
Mon, 18 Sep 2023 17:53:31 +0000 (13:53 -0400)
committerasineath-onpoint <145380373+asineath-onpoint@users.noreply.github.com>
Mon, 18 Sep 2023 17:53:31 +0000 (13:53 -0400)
Remove all existing validation error classes before applying current error classes in validateInput, in order to remove messages for validation rules that have been satisfied by most recent value change, even if other rules are still invalid

js/foundation.abide.js

index cd1aca3490707333a2bd1bdfe60d1c68ed959f53..dda09017159780558794b261051a577b35c242ff 100644 (file)
@@ -510,10 +510,9 @@ class Abide extends Plugin {
     }
 
     if (manageErrorClasses) {
+      this.removeErrorClasses($el);
       if (!goodToGo) {
-        this.addErrorClasses($el, failedValidators);
-      } else {
-        this.removeErrorClasses($el);
+          this.addErrorClasses($el, failedValidators);
       }
     }