Skip to content

Commit

Permalink
handle title link click
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanschingeck committed Apr 25, 2024
1 parent 5d4d60d commit 2720e9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,20 @@ export function AppCardAppTitle({
truncate = false,
appTitle,
}: AppCardAppTitleProps) {
const handleOnClick = (event: React.MouseEvent) => {
event.preventDefault();
event.stopPropagation();
onTitleClick();
};

const textVariant = VARIANT_TO_TEXT_VARIANT[variant ?? 'default'];
return (
<div className={styles.TitleContainer}>
<UnstyledLink className={styles.TitleLink} onClick={onTitleClick}>
<UnstyledLink
url="#"
className={styles.TitleLink}
onClick={handleOnClick}
>
<Text truncate={truncate} variant={textVariant} as="h3">
{appTitle}
</Text>
Expand Down
1 change: 1 addition & 0 deletions polaris-react/src/components/AppIcon/AppIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export function AppIcon({

return (
<UnstyledLink
href="#"
role={source ? 'link' : 'region'}
className={!disabled ? styles.IconLink : undefined}
onClick={handleClick}
Expand Down

0 comments on commit 2720e9f

Please sign in to comment.