diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index e2a9974e832705936a2c0057a4f954b733a43ec3..8eac7344904dac4ed0ee28070abd1da1c7ab35ac 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -549,7 +549,12 @@ export class FormComponent implements OnInit { } public canExit(): Promise<boolean> { - return new Promise((resolve) => this.showModal(resolve)); + // Avoid confirmation when user submit form and leave. + if (this.currentPage == this.nbPagesForm) { + return new Promise((resolve) => resolve(true)); + } else { + return new Promise((resolve) => this.showModal(resolve)); + } } public showConfirmationModal = false; private resolve: Function;