From ade0f73ca452a93660a95341820c27b319ff2562 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Tue, 24 Sep 2024 13:02:37 +0200 Subject: [PATCH] Merge pull request #29175 from JSMike/patch-1 Fix composed storybook TooltipLinkList bug where href isn't passed forward (cherry picked from commit 1a50094cd511ce7c27b9a0cf7b29075949b33263) --- code/core/src/components/components/tooltip/ListItem.tsx | 2 +- .../src/components/components/tooltip/TooltipLinkList.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/core/src/components/components/tooltip/ListItem.tsx b/code/core/src/components/components/tooltip/ListItem.tsx index 068ab88d59c2..8d50a05273de 100644 --- a/code/core/src/components/components/tooltip/ListItem.tsx +++ b/code/core/src/components/components/tooltip/ListItem.tsx @@ -169,7 +169,7 @@ const getItemProps = memoize(100)((onClick, href, LinkWrapper) => ({ export type LinkWrapperType = (props: any) => ReactNode; -export interface ListItemProps extends Omit, 'href' | 'title'> { +export interface ListItemProps extends Omit, 'title'> { loading?: boolean; title?: ReactNode; center?: ReactNode; diff --git a/code/core/src/components/components/tooltip/TooltipLinkList.tsx b/code/core/src/components/components/tooltip/TooltipLinkList.tsx index 51540335d034..f1467babec3a 100644 --- a/code/core/src/components/components/tooltip/TooltipLinkList.tsx +++ b/code/core/src/components/components/tooltip/TooltipLinkList.tsx @@ -22,7 +22,7 @@ export interface Link extends Omit { id: string; onClick?: ( event: SyntheticEvent, - item: Pick + item: Pick ) => void; } @@ -31,11 +31,11 @@ interface ItemProps extends Link { } const Item = ({ id, onClick, ...rest }: ItemProps) => { - const { active, disabled, title } = rest; + const { active, disabled, title, href } = rest; const handleClick = useCallback( - (event: SyntheticEvent) => onClick?.(event, { id, active, disabled, title }), - [onClick, id, active, disabled, title] + (event: SyntheticEvent) => onClick?.(event, { id, active, disabled, title, href }), + [onClick, id, active, disabled, title, href] ); return ;