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

FB16679936: In SwiftUI, it should be possible to have an item with a submenu be checked, meaning to mark a Menu in a Menu as checked (checkmark) #618

Open
sindresorhus opened this issue Mar 1, 2025 · 0 comments

Comments

@sindresorhus
Copy link
Member

  • Date: 2025-03-01
  • Resolution: Open
  • Area: SwiftUI
  • OS: macOS 15.2
  • Type: Suggestion

Description

In AppKit, you can have a menu with submenus, and have the menu item that contains the submenu be checked. In SwiftUI, to have a menu item be checked we need to use Toggle or a Picker. This means, it’s impossible to get a menu item that is both checked and contains a submenu.

Use-case: I created a font picker using a Menu. Each item in the main menu is a font name. Some fonts have sub-types, which goes into a submenu, but I still want to show a checkmark for the main item, even if a subtype is checked too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant