Skip to content

Commit

Permalink
fix(core): reference links not opening correct pane
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Nov 2, 2023
1 parent c64d0e2 commit 19509d8
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

0 comments on commit 19509d8

Please sign in to comment.