From 1565a49f684562a0f90c7f7efca89a52e178a99a Mon Sep 17 00:00:00 2001 From: Mercy Chrysolite <48274621+mcchrys@users.noreply.github.com> Date: Fri, 29 May 2020 16:13:18 +0530 Subject: [PATCH] [ACA-3286] User gets error when removing the attached file (#5735) --- lib/core/form/components/form-field/form-field.component.ts | 4 +++- .../components/widgets/attach-file/upload-cloud.widget.ts | 2 +- 2 files changed, 4 insertions(+), 2 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 0b0c9eecb1..fc103e3953 100644 --- a/lib/core/form/components/form-field/form-field.component.ts +++ b/lib/core/form/components/form-field/form-field.component.ts @@ -159,6 +159,8 @@ export class FormFieldComponent implements OnInit, OnDestroy { } focusToggle() { - this.focus = !this.focus; + setTimeout(() => { + 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 d14474fcac..7d50357170 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 = this.field.form.values[this.field.id].length > 0; + this.hasFile = true; } else { this.field.value = []; this.field.form.values[this.field.id] = [];