Skip to content

Commit 5c0ead3

Browse files
authored
fix(uui-card-media): should render images correctly
1 parent eceafab commit 5c0ead3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/uui-card-media/lib/uui-card-media.element.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,23 @@ export class UUICardMediaElement extends UUICardElement {
135135
demandCustomElement(this, 'uui-symbol-file');
136136
}
137137

138-
private queryPreviews(e: any): void {
138+
private queryPreviews(e: Event): void {
139139
this.hasPreview =
140-
(e.path[0] as HTMLSlotElement).assignedElements({ flatten: true })
141-
.length > 0;
140+
(e.composedPath()[0] as HTMLSlotElement).assignedElements({
141+
flatten: true,
142+
}).length > 0;
142143
}
143144

144145
protected renderMedia() {
145-
if (this.hasPreview === false) {
146-
if (this.fileExt === '') {
147-
return html`<uui-symbol-folder id="folder-symbol"></uui-symbol-folder>`;
148-
} else {
149-
return html`<uui-symbol-file
150-
id="file-symbol"
151-
type="${this.fileExt}"></uui-symbol-file>`;
152-
}
146+
if (this.hasPreview === true) return '';
147+
148+
if (this.fileExt === '') {
149+
return html`<uui-symbol-folder id="folder-symbol"></uui-symbol-folder>`;
153150
}
154-
return '';
151+
152+
return html`<uui-symbol-file
153+
id="file-symbol"
154+
type="${this.fileExt}"></uui-symbol-file>`;
155155
}
156156

157157
public render() {

0 commit comments

Comments
 (0)