Skip to content

Commit e92f0bc

Browse files
authored
override to open inline AI search links in a new tab (#55168)
1 parent e35856c commit e92f0bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/frame/components/ui/MarkdownContent/UnrenderedMarkdownContent.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ export const UnrenderedMarkdownContent = ({
6060
{...props}
6161
href={href}
6262
target={openLinksInNewTab ? '_blank' : undefined}
63+
rel={openLinksInNewTab ? 'noopener noreferrer' : undefined}
64+
onClick={(e) => {
65+
// For some reason we need to override the default onClick to get these links to open in a new tab
66+
if (openLinksInNewTab) {
67+
e.stopPropagation()
68+
e.preventDefault()
69+
window.open(href, '_blank')
70+
}
71+
}}
6372
data-group-key={eventGroupKey}
6473
data-group-id={eventGroupId}
6574
>

0 commit comments

Comments
 (0)