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

Disabled MenuItem should not display subMenuItems? #1925

Closed
GerardasB opened this issue Mar 18, 2024 · 2 comments · Fixed by #1942
Closed

Disabled MenuItem should not display subMenuItems? #1925

GerardasB opened this issue Mar 18, 2024 · 2 comments · Fixed by #1942
Labels
bug Something isn't working has workaround This issue has a workaround or is possible to achieve in user-land.

Comments

@GerardasB
Copy link

Describe the bug (current behavior)

Currently a disabled menu item will show it's subMenuItems. Does it make sense to change this behavior?
I.e. a disabled MenuItem will not call it's onClick handler.

Expected Behavior

A disabled menu item should not show subMenuItems when hovered.

Link to minimal repro

https://stackblitz.com/edit/github-cpdu8r?file=src%2FApp.tsx

Steps To Reproduce

  • Click Menu
  • Hover Item 1_2 (note: this item is disabled)
  • Observe that the submenu is opened.

Anything else?

This can be handled conditionally at the consumer level, i.e.:
<MenuItem disabled={disabled} subMenuItems={disabled ? undefined : subMenuItems} />

@GerardasB GerardasB added bug Something isn't working has workaround This issue has a workaround or is possible to achieve in user-land. labels Mar 18, 2024
@mayank99
Copy link
Contributor

I think it kinda makes sense. Click and hover/focus are different actions. Disabled only disables clicks by default.

If we ever support #879, I think disabling subMenuItems makes sense.

Since this issue has a pretty simple workaround, I will close this issue.

@mayank99 mayank99 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2024
@mayank99
Copy link
Contributor

mayank99 commented May 2, 2024

This is fixed / made consistent in 3.10.0 🚀

@mayank99 mayank99 closed this as completed May 2, 2024
@mayank99 mayank99 linked a pull request May 2, 2024 that will close this issue
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has workaround This issue has a workaround or is possible to achieve in user-land.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants