ciscoheat / sveltekit-superforms

Making SvelteKit forms a pleasure to use!
https://superforms.rocks
MIT License
2.14k stars 64 forks source link

Submitting without tainting a field doesn't show errors if cancel is called #438

Open macmillen opened 3 months ago

macmillen commented 3 months ago

Description Submitting without tainting a field doesn't show errors if cancel is called inside the onUpdate event.

If applicable, a MRE https://www.sveltelab.dev/so7vxl58n4cb4ki

ciscoheat commented 3 months ago

Client-side validation runs before onUpdate, so it will show up even when cancel is called.

macmillen commented 3 months ago

@ciscoheat Is that intended? What's the reason for that?

ciscoheat commented 1 month ago

Client-side validation runs as default on input and blur of the fields, so it has nothing to do with the submit process. Check validationMethod for options: https://superforms.rocks/concepts/client-validation#validationmethod