Skip to content

Commit 564f4ed

Browse files
authored
Merge pull request pnp#1485 from 6gal6ler6/svillaltav3
`ListItemAttachments` : FIX: Cannot download items when it has a ilegal character
2 parents 391c821 + 01dc884 commit 564f4ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/controls/listItemAttachments/ListItemAttachments.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ export class ListItemAttachments extends React.Component<IListItemAttachmentsPro
274274
directionalHint={DirectionalHint.rightCenter}>
275275

276276
<DocumentCard
277-
onClickHref={!openAttachmentsInNewWindow && `${file.ServerRelativeUrl}?web=1`}
278-
onClick={openAttachmentsInNewWindow && (() => window.open(`${file.ServerRelativeUrl}?web=1`, "_blank"))} // JJ - 20200613 - needed to support Microsoft Teams
277+
onClickHref={!openAttachmentsInNewWindow && `${encodeURIComponent(file.ServerRelativeUrl)}?web=1`}
278+
onClick={openAttachmentsInNewWindow && (() => window.open(`${encodeURIComponent(file.ServerRelativeUrl)}?web=1`, "_blank"))} // JJ - 20200613 - needed to support Microsoft Teams
279279
className={styles.documentCard}>
280280
<DocumentCardPreview previewImages={[previewImage]} />
281281
<Label className={styles.fileLabel}>{fileName}</Label>

0 commit comments

Comments
 (0)