-
Notifications
You must be signed in to change notification settings - Fork 15
fix(menu): correctly identify menu item link with same URL as web page #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a5c22a9
0a3cd4f
a2da6ed
82c5cbd
33dbe71
374bc72
0a234c9
56e5179
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,16 +54,22 @@ const Item = ({ item, getItemProps, focusedValue, isSelected }: MenuItemProps) = | |
'cursor-pointer': !item.disabled, | ||
'cursor-default': item.disabled | ||
})} | ||
role={itemProps.href ? 'none' : undefined} | ||
{...(!itemProps.href && (itemProps as LiHTMLAttributes<HTMLLIElement>))} | ||
role={item.href ? 'none' : undefined} | ||
{...(!item.href && (itemProps as LiHTMLAttributes<HTMLLIElement>))} | ||
> | ||
{itemProps.href ? ( | ||
{item.href ? ( | ||
<a | ||
{...(itemProps as AnchorHTMLAttributes<HTMLAnchorElement>)} | ||
Comment on lines
+57
to
62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I don't want to block this PR, but normally a container would expose a prop spread per element. So depending on whether there's a defined If you decide to render with a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, should the README (https://zendeskgarden.github.io/react-containers/?path=/docs/packages-menu--docs#usemenu) be updated with an anchor example? Again, might be a lot cleaner if we wait to have |
||
className="w-full rounded-sm outline-offset-0 transition-none border-width-none" | ||
className={classNames( | ||
' w-full rounded-sm outline-offset-0 transition-none border-width-none', | ||
{ | ||
'text-grey-400': item.disabled, | ||
'cursor-default': item.disabled | ||
} | ||
)} | ||
> | ||
{itemChildren} | ||
{!!item.isExternal && ( | ||
{!!item.external && ( | ||
<> | ||
<span aria-hidden="true"> ↗</span> | ||
<span className="sr-only">(opens in new window)</span> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an item treatment that can be done for anchor items if
selected
is true? It would be nice to see a visual change here in the containers storybook (as opposed toreact-components
where we don't want any visual artifact).