diff --git a/projects/angular-ui/src/lib/file/file-input.component.scss b/projects/angular-ui/src/lib/file/file-input.component.scss index df8d1fae..555e9050 100644 --- a/projects/angular-ui/src/lib/file/file-input.component.scss +++ b/projects/angular-ui/src/lib/file/file-input.component.scss @@ -66,6 +66,11 @@ bao-file-input { } } } + .bao-file-preview { + &:first-child { + margin-top: 1rem; + } + } .bao-error { margin-top: 0.5rem; } diff --git a/projects/angular-ui/src/lib/file/file-input.component.ts b/projects/angular-ui/src/lib/file/file-input.component.ts index a6387675..cbf1c615 100644 --- a/projects/angular-ui/src/lib/file/file-input.component.ts +++ b/projects/angular-ui/src/lib/file/file-input.component.ts @@ -273,10 +273,14 @@ export class BaoFileInputComponent private setDescribedByAttribute(): void { const helperText = Array.from(this.nativeElement.children).find( (el: HTMLElement) => el.localName === 'bao-guiding-text' - ).firstElementChild; + ); if (helperText) { this._helperTextId = `bao-guiding-text-${fileTextUniqueId++}`; - this.renderer.setAttribute(helperText, 'id', this._helperTextId); + this.renderer.setAttribute( + helperText.firstElementChild, + 'id', + this._helperTextId + ); const inputElement = Array.from(this.nativeElement.children) .find((el: HTMLElement) => el.className == 'file-drop-zone') .children.item(1); diff --git a/projects/angular-ui/src/lib/file/file-preview.component.scss b/projects/angular-ui/src/lib/file/file-preview.component.scss index 5cd934ad..19189e42 100644 --- a/projects/angular-ui/src/lib/file/file-preview.component.scss +++ b/projects/angular-ui/src/lib/file/file-preview.component.scss @@ -8,9 +8,6 @@ padding-top: 0.625rem; padding-bottom: 0.625rem; list-style-type: none; - &:first-child { - margin-top: 1rem; - } > .bao-file-info { display: flex; align-items: center;