#Native Menu Shortcuts (again)
9 messages · Page 1 of 1 (latest)
Is there Maybe any error in my init code?
let about_menu = Submenu::new(
"OZG Development",
Menu::new()
.add_native_item(MenuItem::Hide)
.add_native_item(MenuItem::HideOthers)
.add_native_item(MenuItem::ShowAll)
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::Quit),
);
let edit_menu = Submenu::new(
"Edit",
Menu::new()
.add_native_item(MenuItem::Undo)
.add_native_item(MenuItem::Redo)
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::Cut)
.add_native_item(MenuItem::Copy)
.add_native_item(MenuItem::Paste)
.add_native_item(MenuItem::SelectAll),
);
let view_menu = Submenu::new(
"View",
Menu::new().add_native_item(MenuItem::EnterFullScreen),
);
let window_menu = Submenu::new(
"Window",
Menu::new()
.add_native_item(MenuItem::Minimize)
.add_native_item(MenuItem::Zoom),
);
let menu = Menu::new()
.add_submenu(about_menu)
.add_submenu(edit_menu)
.add_submenu(view_menu)
.add_submenu(window_menu);
tauri::Builder::default()
.menu(menu)
hmm, can you run cargo update in your src-tauri dir and try again? Just to double check that everything is up to date.
Sure, here are my dependencies in Cargo.toml
[build-dependencies]
tauri-build = { version = "1.2.1", features = [] }
[dependencies]
serde_json = "1.0"
serde_yaml = "0.9"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2.4", features = ["api-all"] }
Here the npm dependencies from package-lock.json:
"@tauri-apps/cli": {
"version": "1.2.3"
},
"@tauri-apps/api": {
"version": "1.2.0"
}
Oh, i think i found it
addEventListener('keypress', (event) => {
const ele = event.composedPath()[0];
if (ele instanceof HTMLInputElement || ele instanceof HTMLAreaElement || ele instanceof HTMLButtonElement) return;
event.preventDefault();
});
Also prevents the native events ☹️
yep, i hit that same issue a few times already in other contexts. Confused me so much 
Thanks for your help, its working now. Can i somewhere set this topic to resolved?
it is already. discord's forum feature is a bit lacking in that department :/ i'll also close the thread then though