diff --git a/src/components/_classes/nested/NestedComponent.js b/src/components/_classes/nested/NestedComponent.js index 6d3a5eb7e4..3f700cf79c 100644 --- a/src/components/_classes/nested/NestedComponent.js +++ b/src/components/_classes/nested/NestedComponent.js @@ -921,6 +921,8 @@ export default class NestedComponent extends Field { } resetValue() { + // Reset values of child components first, then reset the parent one, otherwise it will restore the default + // value of parent component and clear it one by one while resetting child components this.getComponents().forEach((comp) => comp.resetValue()); super.resetValue(); this.setPristine(true); diff --git a/src/components/_classes/nesteddata/NestedDataComponent.js b/src/components/_classes/nesteddata/NestedDataComponent.js index 54c4fc71c5..82b62b41fe 100644 --- a/src/components/_classes/nesteddata/NestedDataComponent.js +++ b/src/components/_classes/nesteddata/NestedDataComponent.js @@ -4,7 +4,7 @@ import NestedComponent from '../nested/NestedComponent'; import _ from 'lodash'; import { componentValueTypes, getComponentSavedTypes } from '../../../utils/utils'; -export default class NestedDataComponent extends NestedComponent { +export default class NestedDataComponent extends NestedComponent { hasChanged(newValue, oldValue) { // If we do not have a value and are getting set to anything other than undefined or null, then we changed. if ( diff --git a/src/components/editgrid/EditGrid.js b/src/components/editgrid/EditGrid.js index 2f51f678d3..add52d689e 100644 --- a/src/components/editgrid/EditGrid.js +++ b/src/components/editgrid/EditGrid.js @@ -1409,16 +1409,6 @@ export default class EditGridComponent extends NestedArrayComponent { this.setNestedValue(component, editRow.data, flags); }); } - - emptyRows() { - this.editRows.forEach((editRow, index) => this.destroyComponents(false, index)); - this.editRows = []; - } - - resetValue() { - super.resetValue(); - // this.emptyRows(); - } } EditGridComponent.prototype.hasChanged = Component.prototype.hasChanged; diff --git a/src/components/selectboxes/SelectBoxes.js b/src/components/selectboxes/SelectBoxes.js index 6919738b63..85a8198259 100644 --- a/src/components/selectboxes/SelectBoxes.js +++ b/src/components/selectboxes/SelectBoxes.js @@ -307,7 +307,7 @@ export default class SelectBoxesComponent extends RadioComponent { return super.setCustomValidity(_.filter(messages, (message) => message.ruleName !=='invalidValueProperty'), dirty, external); } else { return super.setCustomValidity(messages, dirty, external); - }; + } } validateValueAvailability(setting, value) {