Skip to content

Commit 10c365d

Browse files
committed
tech(pat-validation): Cleanup.
1 parent 1615c30 commit 10c365d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/pat/validation/validation.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,6 @@ class Pattern extends BasePattern {
338338
})
339339
}
340340
}
341-
342-
if (!validity_state.customError) {
343-
// No error to handle. Return.
344-
this.remove_error({ input });
345-
return;
346-
}
347341
} else {
348342
// Default error cases with custom messages.
349343

@@ -405,6 +399,12 @@ class Pattern extends BasePattern {
405399

406400
}
407401

402+
if (validity_state.valid) {
403+
// No error to handle. Remove eventual error and return.
404+
this.remove_error({ input });
405+
return;
406+
}
407+
408408
if (event?.type === "submit") {
409409
// Do not submit in error case and prevent other handlers to take action.
410410
event.preventDefault();

0 commit comments

Comments
 (0)