Skip to content

Commit b5b3c43

Browse files
committed
fix(pat-validation): Clear custom errors to send the input be again in it's valid state.
1 parent d5bc110 commit b5b3c43

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/pat/validation/validation.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class Pattern extends BasePattern {
317317

318318
if (!validity_state.customError) {
319319
// No error to handle. Return.
320-
this.remove_error(input, true);
320+
this.remove_error(input, true, false, true);
321321
return;
322322
}
323323
} else {
@@ -414,15 +414,18 @@ class Pattern extends BasePattern {
414414
}
415415
}
416416

417-
remove_error(input, all_of_group = false, skip_event = false) {
418-
// Remove error message and related referencesfrom input.
417+
remove_error(input, all_of_group = false, skip_event = false, clear_complete = false) {
418+
// Remove error message and related references from input.
419419

420420
let inputs = [input];
421421
if (all_of_group) {
422422
// Get all inputs with the same name - e.g. radio buttons, checkboxes.
423423
inputs = this.inputs.filter((it) => it.name === input.name);
424424
}
425425
for (const it of inputs) {
426+
if (clear_complete) {
427+
this.set_error({ input: it, msg: "", skip_event: true });
428+
}
426429
const error_node = it[KEY_ERROR_EL];
427430
it[KEY_ERROR_EL] = null;
428431
error_node?.remove();

0 commit comments

Comments
 (0)