1
0

[835] Auto-save in new Item Submission form breaks the form

Minor changes and cleanup.
This commit is contained in:
Alessandro Martelli
2020-11-20 18:17:17 +01:00
parent 999993734f
commit 55bcdf0a25
9 changed files with 14 additions and 49 deletions

View File

@@ -131,12 +131,6 @@ export class SubmissionSectionformComponent extends SectionModelComponent {
*/
@ViewChild('formRef', {static: false}) private formRef: FormComponent;
/**
* Keep track whether the section is focused or not.
* @protected
*/
protected isFocused = false;
/**
* Initialize instance variables
*
@@ -265,6 +259,7 @@ export class SubmissionSectionformComponent extends SectionModelComponent {
Object.keys(diffObj)
.forEach((key) => {
diffObj[key].forEach((value) => {
// the findIndex extra check excludes values already present in the form but in different positions
if (value.hasOwnProperty('value') && findIndex(this.formData[key], { value: value.value }) < 0) {
diffResult.push(value);
}
@@ -407,7 +402,6 @@ export class SubmissionSectionformComponent extends SectionModelComponent {
* the [[DynamicFormControlEvent]] emitted
*/
onFocus(event: DynamicFormControlEvent): void {
this.isFocused = true;
const value = this.formOperationsService.getFieldValueFromChangeEvent(event);
const path = this.formBuilderService.getPath(event.model);
if (this.formBuilderService.hasMappedGroupValue(event.model)) {
@@ -419,17 +413,6 @@ export class SubmissionSectionformComponent extends SectionModelComponent {
}
}
/**
* Method called when a form dfBlur event is fired.
*
* @param event
* the [[DynamicFormControlEvent]] emitted
*/
onBlur(event: DynamicFormControlEvent): void {
this.isFocused = false;
}
/**
* Method called when a form remove event is fired.
* Dispatch form operations based on changes.