diff --git a/packages/ui/src/components/Menu/Menu.module.css b/packages/ui/src/components/Menu/Menu.module.css index 31aae5a990..d6843103a9 100644 --- a/packages/ui/src/components/Menu/Menu.module.css +++ b/packages/ui/src/components/Menu/Menu.module.css @@ -87,6 +87,7 @@ color: var(--bui-fg-primary); font-size: var(--bui-font-size-3); gap: var(--bui-space-6); + cursor: pointer; &[data-focus-visible] { outline: 2px solid var(--bui-ring); @@ -129,6 +130,7 @@ cursor: default; color: var(--bui-fg-primary); font-size: var(--bui-font-size-3); + cursor: pointer; &[data-focus-visible] { outline: 2px solid var(--bui-ring); diff --git a/packages/ui/src/components/Menu/Menu.tsx b/packages/ui/src/components/Menu/Menu.tsx index 2c411dd4c9..8008a071bb 100644 --- a/packages/ui/src/components/Menu/Menu.tsx +++ b/packages/ui/src/components/Menu/Menu.tsx @@ -308,51 +308,26 @@ export const MenuItem = (props: MenuItemProps) => { ); const { classes, iconStart, children, href } = ownProps; - const captureHrefClick = () => { - if (href) { - const text = - restProps['aria-label'] ?? getNodeText(children) ?? String(href); - analytics.captureEvent('click', text, { - attributes: { to: String(href) }, - }); - } - }; - - // External links open in new tab via window.open instead of client-side routing - if (href && !isInternalLink(href)) { - return ( - { - restProps.onAction?.(); - captureHrefClick(); - window.open(href, '_blank', 'noopener,noreferrer'); - }} - > -
- {iconStart} - {children} -
-
- -
-
- ); - } + const isExternal = href && !isInternalLink(href); return ( { restProps.onAction?.(); - captureHrefClick(); + if (href) { + const text = + restProps['aria-label'] ?? getNodeText(children) ?? String(href); + analytics.captureEvent('click', text, { + attributes: { to: String(href) }, + }); + } }} >