Skip to content

Commit 754398a

Browse files
committed
fix: make the whole file item clickable
1 parent d44e5c3 commit 754398a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,16 @@
189189
"
190190
></video>
191191
</div>
192-
<div
192+
<a
193193
*ngIf="isFile(attachment)"
194194
class="
195195
str-chat__message-attachment-file--item
196196
str-chat-angular__message-attachment-file-single
197197
"
198+
style="cursor: pointer; text-decoration: none"
199+
data-testclass="file-link"
200+
href="{{ attachment.asset_url }}"
201+
target="_blank"
198202
>
199203
<stream-icon-placeholder
200204
*ngIf="themeVersion === '1'"
@@ -214,7 +218,8 @@
214218
>
215219
{{ attachment.title }}
216220
</div>
217-
<a
221+
<!-- Temporary disabled, will be fixed with this: https://github.com/GetStream/stream-chat-angular/issues/393 -->
222+
<!-- <a
218223
class="str-chat__message-attachment-file--item-download"
219224
data-testclass="file-link"
220225
download
@@ -225,7 +230,7 @@
225230
class="str-chat__message-attachment-download-icon"
226231
icon="download"
227232
></stream-icon-placeholder>
228-
</a>
233+
</a> -->
229234
</div>
230235
<span
231236
class="str-chat__message-attachment-file--item-size"
@@ -234,7 +239,7 @@
234239
>{{ getFileSize(attachment) }}</span
235240
>
236241
</div>
237-
</div>
242+
</a>
238243
<div
239244
*ngIf="
240245
isCard(attachment) &&

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ describe('AttachmentListComponent', () => {
424424
const link = queryFileLinks()[0];
425425
const titleElement = queryFileNames()[0];
426426

427-
expect(link.hasAttribute('download')).toBeTrue();
428427
expect(link.href).toContain(asset_url);
429428
expect(titleElement.textContent).toContain(title);
430429
});
@@ -467,7 +466,6 @@ describe('AttachmentListComponent', () => {
467466
fixture.detectChanges();
468467
const link = queryFileLinks()[0];
469468

470-
expect(link.hasAttribute('download')).toBeTrue();
471469
expect(link.href).toContain('unsafe:' + asset_url);
472470
});
473471

0 commit comments

Comments
 (0)