Skip to content

Commit

Permalink
Update TooltipLinkList.tsx to add href to item object for onclick events
Browse files Browse the repository at this point in the history
  • Loading branch information
JSMike committed Sep 21, 2024
1 parent 221f6a7 commit b11edcf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ListItem id={`list-item-${id}`} {...rest} {...(onClick && { onClick: handleClick })} />;
Expand Down

0 comments on commit b11edcf

Please sign in to comment.