Form: confirm dialog before submitting check-in
Adds a native window.confirm() inside onSubmit, after the uploads-in-flight guard and before the submitting-state flip. Runs only after react-hook-form validation passes, so users who hit Submit on an incomplete form still see the existing field-level errors via onInvalid rather than a confusing "are you sure?" prompt. Cancelling leaves the form state untouched.
This commit is contained in:
@@ -300,6 +300,12 @@ export function EngagementForm({ config, cid, cs }: EngagementFormProps) {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const confirmed = window.confirm(
|
||||||
|
"Submit your check-in?\n\n" +
|
||||||
|
"Please confirm your responses are complete and ready. " +
|
||||||
|
"After submitting, you can come back later and submit another check-in with updates.",
|
||||||
|
);
|
||||||
|
if (!confirmed) return;
|
||||||
setSubmitState({ kind: "submitting" });
|
setSubmitState({ kind: "submitting" });
|
||||||
try {
|
try {
|
||||||
// Strip values for hidden fields — never write data the user couldn't see.
|
// Strip values for hidden fields — never write data the user couldn't see.
|
||||||
|
|||||||
Reference in New Issue
Block a user