Skip to content

Commit 1a50094

Browse files
authored
Merge pull request #29175 from JSMike/patch-1
Fix composed storybook TooltipLinkList bug where href isn't passed forward
2 parents caa4ff3 + 91c2e9d commit 1a50094

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

code/core/src/components/components/tooltip/ListItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ const getItemProps = memoize(100)((onClick, href, LinkWrapper) => ({
169169

170170
export type LinkWrapperType = (props: any) => ReactNode;
171171

172-
export interface ListItemProps extends Omit<ComponentProps<typeof Item>, 'href' | 'title'> {
172+
export interface ListItemProps extends Omit<ComponentProps<typeof Item>, 'title'> {
173173
loading?: boolean;
174174
title?: ReactNode;
175175
center?: ReactNode;

code/core/src/components/components/tooltip/TooltipLinkList.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface Link extends Omit<ListItemProps, 'onClick'> {
2222
id: string;
2323
onClick?: (
2424
event: SyntheticEvent,
25-
item: Pick<ListItemProps, 'id' | 'active' | 'disabled' | 'title'>
25+
item: Pick<ListItemProps, 'id' | 'active' | 'disabled' | 'title' | 'href'>
2626
) => void;
2727
}
2828

@@ -31,11 +31,11 @@ interface ItemProps extends Link {
3131
}
3232

3333
const Item = ({ id, onClick, ...rest }: ItemProps) => {
34-
const { active, disabled, title } = rest;
34+
const { active, disabled, title, href } = rest;
3535

3636
const handleClick = useCallback(
37-
(event: SyntheticEvent) => onClick?.(event, { id, active, disabled, title }),
38-
[onClick, id, active, disabled, title]
37+
(event: SyntheticEvent) => onClick?.(event, { id, active, disabled, title, href }),
38+
[onClick, id, active, disabled, title, href]
3939
);
4040

4141
return <ListItem id={`list-item-${id}`} {...rest} {...(onClick && { onClick: handleClick })} />;

0 commit comments

Comments
 (0)