Skip to content
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

Cannot use arrow keys to navigate menus when the first MenuItem is wrapped in a Fragment #21508

Closed
2 tasks done
phudlow opened this issue Jun 19, 2020 · 1 comment
Closed
2 tasks done
Labels
component: menu This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@phudlow
Copy link

phudlow commented Jun 19, 2020

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Should be able to use the arrow (up and down keys) to select MenuItems when any MenuItems are wrapped in a React.Fragment.

Expected Behavior 🤔

For the first MenuItem only, if it is wrapped in a React.Fragment, you cannot use arrow keys to navigate MenuItems in that Menu.

Steps to Reproduce 🕹

First Menuitem Wrapped in Fragment (broken)
https://codesandbox.io/s/only-second-menuitem-not-wrapped-in-fragment-h1s6f

First Menuitem Not Wrapped in Fragment (ok, works)
https://codesandbox.io/s/only-first-menuitem-not-wrapped-in-fragment-ym4fr

Whether or not MenuItems besides the first are wrapped in Fragments has no effect. Only the first MenuItem being wrapped in a Fragment causes the bug.

Context 🔦

We have a component that may block rendering of children based on condition that checks permissions. If we render the children it returns <>{props.children}</> rather than null

Your Environment 🌎

Tech Version
Material-UI v4.10.12
React v16.12.0
Browser Chrome v83.0.4103.106
TypeScript n/a
@phudlow phudlow added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 19, 2020
@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists component: menu This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 19, 2020
@oliviertassinari
Copy link
Member

Closing for #14943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants