Skip to content

Commit

Permalink
FIO-8146 fixed saveDraft triggering for nested forms after submitting
Browse files Browse the repository at this point in the history
  • Loading branch information
HannaKurban committed Apr 4, 2024
1 parent 37b6beb commit 2fe6f14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,10 @@ export default class FormComponent extends Component {
*/
beforeSubmit() {
const submission = this.dataValue;
// Cancel triggered saveDraft
if (this.subForm.draftEnabled && this.subForm.triggerSaveDraft?.cancel) {
this.subForm.triggerSaveDraft.cancel();
}

const isAlreadySubmitted = submission && submission._id && submission.form;

Expand Down

0 comments on commit 2fe6f14

Please sign in to comment.