From 084dacde26a481240ac75ed62fece08198d0c8dc Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 29 May 2020 11:58:49 +0100 Subject: [PATCH] Revert "[ACA-3286] User gets error when removing the attached file (#5735)" (#5738) This reverts commit 1565a49f684562a0f90c7f7efca89a52e178a99a. --- lib/core/form/components/form-field/form-field.component.ts | 4 +--- .../components/widgets/attach-file/upload-cloud.widget.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/core/form/components/form-field/form-field.component.ts b/lib/core/form/components/form-field/form-field.component.ts index fc103e3953..0b0c9eecb1 100644 --- a/lib/core/form/components/form-field/form-field.component.ts +++ b/lib/core/form/components/form-field/form-field.component.ts @@ -159,8 +159,6 @@ export class FormFieldComponent implements OnInit, OnDestroy { } focusToggle() { - setTimeout(() => { - this.focus = !this.focus; - }); + this.focus = !this.focus; } } diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/upload-cloud.widget.ts b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/upload-cloud.widget.ts index 7d50357170..d14474fcac 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/upload-cloud.widget.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/upload-cloud.widget.ts @@ -151,7 +151,7 @@ export class UploadCloudWidgetComponent extends WidgetComponent implements OnIni if (values && values.length > 0) { this.field.value = values; this.field.form.values[this.field.id] = values; - this.hasFile = true; + this.hasFile = this.field.form.values[this.field.id].length > 0; } else { this.field.value = []; this.field.form.values[this.field.id] = [];