Skip to content

Commit

Permalink
Add back logics
Browse files Browse the repository at this point in the history
  • Loading branch information
epi-qang2 committed Dec 14, 2023
1 parent 261bd6c commit 78ccfa7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/@episerver/forms-react/src/components/FormBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export const FormBody = (props: FormBodyProps) => {
currentStepIndex = formContext?.currentStepIndex ?? 0,
isStepValidToDisplay = true;

if (isSuccess.current && isFormFinalized.current) {
if((isFormFinalized.current || isProgressiveSubmit.current) && isSuccess.current)
{
statusDisplay.current = "Form__Success__Message";
statusMessage.current = form.properties.submitSuccessMessage ?? message.current;
}
Expand All @@ -45,6 +46,7 @@ export const FormBody = (props: FormBodyProps) => {
statusDisplay.current = "Form__Warning__Message";
statusMessage.current = message.current;
}

const validationCssClass = validateFail.current ? "ValidationFail" : "ValidationSuccess";

const handleSubmit = (e: any) => {
Expand Down Expand Up @@ -102,7 +104,8 @@ export const FormBody = (props: FormBodyProps) => {
message.current = response.messages.filter(m => isNullOrEmpty(m.identifier)).map(m => m.message).join("<br>");
}
validateFail.current = response.validationFail;
isFormFinalized.current = isSuccess.current = response.success;
isSuccess.current = response.success;
isFormFinalized.current = formContext?.currentStepIndex === form.steps.length - 1 && response.success;
dispatchFunctions.updateSubmissionKey(response.submissionKey);
dispatchFunctions.updateIsSubmitting(false);
});
Expand Down

0 comments on commit 78ccfa7

Please sign in to comment.