Skip to content

Commit

Permalink
fix(core): reference links not opening correct pane (#5116)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars authored Nov 3, 2023
1 parent c64d0e2 commit ba7a558
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ export const ReferenceLinkCard = forwardRef(function ReferenceLinkCard(
props: ReferenceLinkCardProps & React.HTMLProps<HTMLElement>,
ref: React.ForwardedRef<HTMLElement>,
) {
const {
as: asProp,
// We exclude `documentId` from spread props to avoid passing it to the Card component
// eslint-disable-next-line @typescript-eslint/no-unused-vars
documentId,
documentType,
...cardProps
} = props
const {as: asProp, documentId, documentType, ...cardProps} = props
const dataAs = documentType ? 'a' : undefined

// If the child link is clicked without a document type, an error will be thrown.
Expand All @@ -48,6 +41,7 @@ export const ReferenceLinkCard = forwardRef(function ReferenceLinkCard(
<StyledCard
{...cardProps}
data-as={dataAs}
documentId={documentId}
documentType={documentType}
forwardedAs={as}
ref={ref as unknown as React.ForwardedRef<HTMLDivElement>}
Expand Down

2 comments on commit ba7a558

@vercel
Copy link

@vercel vercel bot commented on ba7a558 Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

performance-studio – ./

performance-studio-git-next.sanity.build
performance-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on ba7a558 Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio-git-next.sanity.build
test-studio.sanity.build

Please sign in to comment.