Can't navigate to <a> or <Link> elements inside <MenuItem> with keyboard
danielksato opened this issue · comments
I'm experiencing an issue on 5.1.1 and 6.0.0 where <a>
elements within a <MenuItem>
can't be followed. They can be focused using the keyboard, and they work as normal when clicked with a mouse, but space
or enter
does not follow the link.
I've worked around this issue using a custom onSelection
for the <Wrapper>
but this is an ugly hack. I'm willing to jump in and submit a PR if nobody else has time.
@danielksato Yeah, it's not really designed to have links within items, since the items themselves are clickable. Always awkward to have a clickable thing within a clickable thing. If you'd like your item to be a link, you can set tag
to 'a'
. But I'm not sure I want to support items that contain links.
That's fair enough - this is kind of a funky design (tabs & panel inside a dropdown) that wasn't built with accessibility in mind originally.