Skip to content

Commit 01dc884

Browse files
committed
Encoded to handle URL specific chars such as #
1 parent 256d4a7 commit 01dc884

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)