Commit c3a9e6917624eb758fcc4f3498a5682a88eedf4c
Committed by
Andrew Shvayka
1 parent
240422aa
Make file input work properly when there are multiple on page
Showing
1 changed file
with
3 additions
and
1 deletions
... | ... | @@ -34,6 +34,7 @@ import { Subscription } from 'rxjs'; |
34 | 34 | import { coerceBooleanProperty } from '@angular/cdk/coercion'; |
35 | 35 | import { FlowDirective } from '@flowjs/ngx-flow'; |
36 | 36 | import { TranslateService } from '@ngx-translate/core'; |
37 | +import { UtilsService } from '@core/services/utils.service'; | |
37 | 38 | |
38 | 39 | @Component({ |
39 | 40 | selector: 'tb-file-input', |
... | ... | @@ -59,7 +60,7 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, |
59 | 60 | noFileText = 'import.no-file'; |
60 | 61 | |
61 | 62 | @Input() |
62 | - inputId = 'select'; | |
63 | + inputId = this.utils.guid(); | |
63 | 64 | |
64 | 65 | @Input() |
65 | 66 | allowedExtensions: string; |
... | ... | @@ -114,6 +115,7 @@ export class FileInputComponent extends PageComponent implements AfterViewInit, |
114 | 115 | private propagateChange = null; |
115 | 116 | |
116 | 117 | constructor(protected store: Store<AppState>, |
118 | + private utils: UtilsService, | |
117 | 119 | public translate: TranslateService) { |
118 | 120 | super(store); |
119 | 121 | } | ... | ... |