Skip to content

Commit c4d2a74

Browse files
AngryBeaverAngryBeaver
AngryBeaver
authored and
AngryBeaver
committed
fix Bug with updateForm method when updating input data only
arrays in data that changed in size needs to increase or decrease formGroup keep it simple stupid it will now always rerender Form with initializeForm.
1 parent 1a5bfee commit c4d2a74

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/lib/src/json-schema-form.component.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,8 @@ export class JsonSchemaFormComponent implements ControlValueAccessor, OnChanges,
223223
}
224224

225225
// If only input values have changed, update the form values
226-
if (changedInput.length === 1 && changedInput[0] === this.formValuesInput) {
227-
if (this.formValuesInput.indexOf('.') === -1) {
228-
this.setFormValues(this[this.formValuesInput], resetFirst);
229-
} else {
230-
const [input, key] = this.formValuesInput.split('.');
231-
this.setFormValues(this[input][key], resetFirst);
232-
}
233-
234226
// If anything else has changed, re-render the entire form
235-
} else if (changedInput.length) {
227+
if (changedInput.length) {
236228
this.initializeForm();
237229
if (this.onChange) { this.onChange(this.jsf.formValues); }
238230
if (this.onTouched) { this.onTouched(this.jsf.formValues); }

0 commit comments

Comments
 (0)