You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In testing #76 in
GitHub.com, we discovered cases where input would be re-validated
on blur even if the input had not changed. This PR updates our
valid and invalid code paths to only validate on blur if the input
has not otherwise been already validated.
(event.type==='blur'&&autoCheckElement.onlyValidateOnBlur)||// Only validate on blur if only-validate-on-blur is set
222
-
(autoCheckElement.onlyValidateOnBlur&&autoCheckElement.validateOnKeystroke)// Only validate on key inputs in only-validate-on-blur mode if validate-on-keystroke is set (when input is invalid)
225
+
(event.type==='blur'&&
226
+
autoCheckElement.onlyValidateOnBlur&&
227
+
!autoCheckElement.validateOnKeystroke&&
228
+
autoCheckElement.hasAttribute('dirty'))||// Only validate on blur if only-validate-on-blur is set, input is dirty, and input is not current validating on keystroke
229
+
(event.type==='input'&&autoCheckElement.onlyValidateOnBlur&&autoCheckElement.validateOnKeystroke)// Only validate on key inputs in only-validate-on-blur mode if validate-on-keystroke is set (when input is invalid)
223
230
){
224
231
setLoadingState(event)
225
232
checker()
@@ -326,6 +333,8 @@ async function check(autoCheckElement: AutoCheckElement) {
0 commit comments