-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[docs] menu item doesn't show up on MacOS #7981
Comments
on macOS, you can't add a menu item directly to the |
@amrbashir thanks for looking into this. For example, I expect the tauri_bug menu will expand with some menu item, however there's no associated dropdown. |
It should take the first subitem automatically, maybe the submenu needs the app name as it's name but i don't think so. For reference here's the implementation of os_menu() which also fills that first menu: https://docs.rs/tauri-runtime/0.14.1/src/tauri_runtime/menu.rs.html#245 |
Yes, that's my expectation. But It doesn't do so now, as my code example shows in: https://github.com/czheo/tauri_bug
I tested creating a submenu with the app name and it creates a different submenu next to the default one: |
Also picking up your comment from the PR:
The reason why this doesn't make sense is mostly due to cross-platform consistency. On Windows and Linux the "parent" items in the menu bar can be basically buttons and don't need submenus to provide functionality. iirc on macOS only submenu items trigger events the app can handle. |
@FabianLars It seems behavior is different by OS version. I guess you are on MacOS 13. It's also weird your title shows nowhere. How are you supposed to create a menu next to the "react" menu then? |
I am, yes. But it used to work on 10.15 last time i used my VM too, can test again today or next week 🤔 What version are you on?
Weird yes, but expected because the first menu item is set by macos reading the app name.
By adding another submenu to the main menu. Each submenu (on the main menu) will be displayed on the menu bar. |
@FabianLars I see what you mean. I'm on |
Will it make more sense that |
To me it wouldn't make more sense than the current approach, no. |
Double thinking this claim. I think it makes sense to me that having similar behaviors on different platforms can have benefit. Cross-platform app builders need not have different code on different platforms. |
Describe the bug
I added a item to the menu like above but it doesn't show up anywhere
Reproduction
Reproduced in https://github.com/czheo/tauri_bug
This is created based on the app template created by
sh <(curl https://create.tauri.app/sh)
.With only this change: czheo/tauri_bug@2317186
Expected behavior
There should be "Hide" button/menu item shown somewhere on the menu bar.
Platform and versions
The text was updated successfully, but these errors were encountered: