MDL-64554 form: reset form change checker before triggering submit event

This commit is contained in:
Marina Glancy
2021-02-18 13:08:33 +01:00
committed by Eloy Lafuente (stronk7)
parent 7f23a739ed
commit 5e343e277b
3 changed files with 10 additions and 7 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8 -5
View File
@@ -381,11 +381,14 @@ export default class ModalForm {
} else {
// Form was submitted properly. Hide the modal and execute callback.
const data = JSON.parse(response.data);
const event = this.trigger(this.events.FORM_SUBMITTED, data);
if (!event.defaultPrevented) {
this.modal.hide();
}
return null;
return this.notifyResetFormChanges()
.then(() => {
const event = this.trigger(this.events.FORM_SUBMITTED, data);
if (!event.defaultPrevented) {
this.modal.hide();
}
return null;
});
}
return null;
})