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
fix: display empty menu item for non-visible submenus #16832
Conversation
9c66473
to
33bfd29
Compare
33bfd29
to
ec241aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what the behavior is on Linux / Windows (with SimpleMenuModel)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Release Notes Persisted
|
I have automatically backported this PR to "4-0-x", please check out #16847 |
I have automatically backported this PR to "5-0-x", please check out #16848 |
I think it would be better to disable the menu if its submenu has no visible items. Even if you disagree, the menu label should at least be |
@sindresorhus this mirrors behavior on macOS itself, and was directly lifted from Chrome, capitalization included: |
I have never seen this behavior outside of Chrome. Example?
Chrome doesn't have a good track record at following native UI conventions. |
I wouldn't use iTerm as an example of good macOS UX. A better example: |
@MarshallOfSound That seems like a bug. Notice how the title is also not titleized and the title should have been something like "No Favorites". I'll report it later. Most likely, no one at Apple noticed, as it's very unlikely not to have a single Favorite. Another example, from Safari (History menu), of the menu being disabled when there are no items: |
Description of Change
Previously, when a context menu was created with a submenu that had no visible
MenuItems
, the menu item would display and not show anything on hover, which i don't believe to be the most user-friendly behavior:This PR improves the UX of that scenario by first checking if a submenu has any visible
MenuItems
, and in the case that it doesn't, it creates a localizedMenuItem
to indicate that the submenu does not currently have any items with which the user may interact:Checklist
npm test
passesRelease Notes
Notes: Fixed issue whereby a user was not well informed when interacting with a menu submenu that did not have any visible
MenuItems
.