Skip to content

Commit 51ff092

Browse files
fix: view tomogram button propogration (#1791)
fix view tomogram button propogration
1 parent b53974d commit 51ff092

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

frontend/packages/data-portal/app/components/ViewTomogramButton.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ export function ViewTomogramButton({
7272
directly because Plausible will overwrite it. */}
7373
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
7474
<div
75-
onClick={trackViewTomogram}
75+
onClick={(e) => {
76+
e.stopPropagation()
77+
trackViewTomogram()
78+
}}
7679
onKeyDown={({ key }) => {
7780
if (key === 'Enter') {
7881
trackViewTomogram()
@@ -83,12 +86,7 @@ export function ViewTomogramButton({
8386
className="min-w-[152px]"
8487
>
8588
<Button
86-
onClick={(e) => {
87-
if (enabled) {
88-
e.stopPropagation()
89-
window.open(getNeuroglancerUrl(neuroglancerConfig), '_blank')
90-
}
91-
}}
89+
href={enabled ? getNeuroglancerUrl(neuroglancerConfig) : undefined}
9290
disabled={!enabled}
9391
LinkComponent={Link}
9492
{...(buttonProps as ButtonProps)}

0 commit comments

Comments
 (0)