From c3a9e6917624eb758fcc4f3498a5682a88eedf4c Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Wed, 24 Feb 2021 13:10:58 +0200 Subject: [PATCH] Make file input work properly when there are multiple on page --- ui-ngx/src/app/shared/components/file-input.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/shared/components/file-input.component.ts b/ui-ngx/src/app/shared/components/file-input.component.ts index 18162cbe8b..1dc64194d9 100644 --- a/ui-ngx/src/app/shared/components/file-input.component.ts +++ b/ui-ngx/src/app/shared/components/file-input.component.ts @@ -34,6 +34,7 @@ import { Subscription } from 'rxjs'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { FlowDirective } from '@flowjs/ngx-flow'; import { TranslateService } from '@ngx-translate/core'; +import { UtilsService } from '@core/services/utils.service'; @Component({ selector: 'tb-file-input', @@ -59,7 +60,7 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, noFileText = 'import.no-file'; @Input() - inputId = 'select'; + inputId = this.utils.guid(); @Input() allowedExtensions: string; @@ -114,6 +115,7 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, private propagateChange = null; constructor(protected store: Store, + private utils: UtilsService, public translate: TranslateService) { super(store); }