Skip to content

Commit b2b659d

Browse files
Fix Issue 1541 - List item attachment OnClick not working
1 parent 7bda9d5 commit b2b659d

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 && `${encodeURIComponent(file.ServerRelativeUrl)}?web=1`}
278-
onClick={openAttachmentsInNewWindow && (() => window.open(`${encodeURIComponent(file.ServerRelativeUrl)}?web=1`, "_blank"))} // JJ - 20200613 - needed to support Microsoft Teams
277+
onClickHref={!openAttachmentsInNewWindow && `${(file.ServerRelativeUrl)}?web=1`} //NB - 20230607 - Fix for issue 1541
278+
onClick={openAttachmentsInNewWindow && (() => window.open(`${(file.ServerRelativeUrl)}?web=1`, "_blank"))} //NB - 20230607 - Fix for issue 1541 // 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)