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

Menu positioning ignores disabled MenuItem #23049

Closed
2 tasks done
igor-pavlichenko opened this issue Oct 14, 2020 · 1 comment
Closed
2 tasks done

Menu positioning ignores disabled MenuItem #23049

igor-pavlichenko opened this issue Oct 14, 2020 · 1 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

Comments

@igor-pavlichenko
Copy link

So this weird jumps are happening.

menuItem_bug_23fps

  • 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 😯

Menu position changes if it contains disabled menu-items

Expected Behavior 🤔

Menu stays at same position.

Steps to Reproduce 🕹

After many hours of debugging while sleeping I woke up and figured out that for some reason disabled menu-items' heights don't count to calculate the positioning.
Is it by design? Is there a way to work around it?

https://codesandbox.io/s/reverent-bird-k7dsj?file=/src/Demo.js

Steps:

  1. create a Menu with MenuItems inside
  2. disable first MenuItem(s)
  3. see that the positioning of Menu ignores the disabled MenuItem

Context 🔦

When the item is clicked, an http request is fired and that item is disabled until request completes. When it completes, the menu is closed.

Your Environment 🌎

Tech Version
Material-UI v5.0.0-alpha.12
React 16.13.1
Browser latest Chrome, Safari, Firefox
@igor-pavlichenko igor-pavlichenko added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 14, 2020
@oliviertassinari oliviertassinari added component: menu This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: question Community support but can be turned into an improvement labels Oct 14, 2020
@oliviertassinari
Copy link
Member

Duplicate of #20755

@oliviertassinari oliviertassinari marked this as a duplicate of #20755 Oct 14, 2020
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