Open TylerAPfledderer opened 1 year ago
Good catch @TylerAPfledderer!
I've forked the shared example, tested it by using the native Gatsby Link and it fails as well. So, seems to me that this is a problem with the Gatsby Link itself and/or the reach router link.
As far as I could see, Gatsby is use the innerRef
prop but in the Reach Router docs it says that innerRef
should only be used with react < v16.4 (while gatsby-link
has react 18 as peer dep).
Not sure if that could be the source of the problem here.
Hello!
Please see this minimal repo using the Link component, as well as the
Link
component andMenu
components from Chakra UI.I am contributing to a project that is using these packages and updating their main navigation to use the
Menu
components. Per Chakra usage, MenuItem normally renders a button, but can be a link. With a11y, you navigate the menu items via the arrow keys and notTab
.In the project,
ChakraLink
is consuming theLink
of this i18next package for the theming, then this custom component is consumed byMenuItem
The current issue is that this approach prevents the execution of
onKeyDown
event happening under the hood from the Chakra package. This event is being passed viaMenuLink
toMenuItem
.Could the
innerRef
being used by i18nextLink
be preventing this handler?With the minimal repo, do the following:
BaseLink
with"a"
for bothMenuItems
's then repeat the process to see the default focus styles on press of the down arrow key.For references:
useMenuList
.useMenuList
is called aslistProps
and spread toMenuTransition
which is a motion component.