-
Notifications
You must be signed in to change notification settings - Fork 55
Menu item href
breaks focus (necessary to TAB twice)
#191
Comments
|
Agree that using At the same time, the following line of // ----------------------------------------
// infer anchor links
if (props.href) return 'a' Where this functionality might come in need? It seems to be always possible for a client to specify So, my suggestion would be to avoid this 'implicit "a"', and as further steps - introduce // MenuItem
renderComponent({ ElementType, classes, accessibility, rest }) {
const { children, content, icon, href } = this.props
const hasChildren = childrenExist(children)
return (
<ElementType ... href={hasChildren ? href : undefined} {...rest}>
{ hasChildren ? children
: (
<a href={href} ... >
...
</a>
)}
</ElementType>
)
} |
Yes, adding |
delete it 👍 |
on top of what was mentioned, all attributes relevant to the |
Fixed by #323 |
Bug Report
Steps
href: '#'
, e.g., with the following code:TAB
key) on the menu.Expected Result
Pressing
TAB
moves you to the next menu item,Shift+TAB
to the previous one.Actual Result
It is necessary to press
TAB
orShift+TAB
twice for each menu item. The reason is that usinghref
changes the menu item into<a>
, so there are now two nested<a>
taking focus one by one.Version
0.5.0
The text was updated successfully, but these errors were encountered: