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
…#5556)

* FIO-8146 fixed saveDraft triggering for nested forms after submitting

* FIO-8146 refactoring
  • Loading branch information
HannaKurban authored Apr 5, 2024
1 parent 083c8d0 commit d33e385
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 @@ -644,6 +644,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 d33e385

Please sign in to comment.