Skip to content

Commit 4761d67

Browse files
committed
Restore customError property in the ValidityState() polyfill
1 parent 94022b0 commit 4761d67

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/js/validityState-polyfill.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@
9393
// Add valid property to validity object
9494
checkValidity.valid = valid;
9595

96+
// Assume a custom error if there is a validation message present but all the other checks returned valid
97+
if (checkValidity.valid && field.validationMessage !== '') {
98+
checkValidity.customError = true
99+
}
100+
96101
// Return object
97102
return checkValidity;
98103

0 commit comments

Comments
 (0)