@formio/js 5.0.0-dev.5886.c52e2a5 → 5.0.0-dev.5889.5851e22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -738,8 +738,7 @@ class Webform extends NestedDataComponent_1.default {
738
738
  this.emit(restoreDraft ? "restoreDraftError" : "saveDraftError", errDetails || errorMessage);
739
739
  }
740
740
  saveDraft() {
741
- var _a;
742
- if (!this.draftEnabled || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.component.reference) === false) {
741
+ if (!this.draftEnabled) {
743
742
  return;
744
743
  }
745
744
  if (!this.formio) {
@@ -1216,7 +1216,7 @@ class SelectComponent extends ListComponent_1.default {
1216
1216
  }
1217
1217
  // Check to see if we need to save off the template data into our metadata.
1218
1218
  const templateValue = this.component.reference && (value === null || value === void 0 ? void 0 : value._id) ? value._id.toString() : value;
1219
- const shouldSaveData = !valueIsObject || this.component.reference;
1219
+ const shouldSaveData = (!valueIsObject || this.component.reference) && !this.inDataTable;
1220
1220
  if (!lodash_1.default.isNil(templateValue) && shouldSaveData && this.templateData && this.templateData[templateValue] && ((_a = this.root) === null || _a === void 0 ? void 0 : _a.submission)) {
1221
1221
  const submission = this.root.submission;
1222
1222
  if (!submission.metadata) {
@@ -742,7 +742,7 @@ export default class Webform extends NestedDataComponent {
742
742
  this.emit(restoreDraft ? "restoreDraftError" : "saveDraftError", errDetails || errorMessage);
743
743
  }
744
744
  saveDraft() {
745
- if (!this.draftEnabled || this.parent?.component.reference === false) {
745
+ if (!this.draftEnabled) {
746
746
  return;
747
747
  }
748
748
  if (!this.formio) {
@@ -1244,7 +1244,7 @@ export default class SelectComponent extends ListComponent {
1244
1244
  }
1245
1245
  // Check to see if we need to save off the template data into our metadata.
1246
1246
  const templateValue = this.component.reference && value?._id ? value._id.toString() : value;
1247
- const shouldSaveData = !valueIsObject || this.component.reference;
1247
+ const shouldSaveData = (!valueIsObject || this.component.reference) && !this.inDataTable;
1248
1248
  if (!_.isNil(templateValue) && shouldSaveData && this.templateData && this.templateData[templateValue] && this.root?.submission) {
1249
1249
  const submission = this.root.submission;
1250
1250
  if (!submission.metadata) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5886.c52e2a5",
3
+ "version": "5.0.0-dev.5889.5851e22",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {