We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
31.0.1
macOS
macOS Sonoma 14.5
arm64 (including Apple Silicon)
No response
Menu.getApplicationMenu() returns menu with valid roles.
As titled. Since this is TypeScript's type issue I created a Stackblitz project here for a reproduction.
https://stackblitz.com/~/github.com/takuyahara/electron-menu-issue?file=src/main.ts:L25
[ { "role": "appmenu", "subItems": [ { "role": "about" }, { "role": null }, { "role": "services" }, { "role": null }, { "role": "hide" }, { "role": "hideothers" }, { "role": "unhide" }, { "role": null }, { "role": "quit" } ] }, { "role": "filemenu", "subItems": [ { "role": "close" } ] }, { "role": "editmenu", "subItems": [ { "role": "undo" }, { "role": "redo" }, { "role": null }, { "role": "cut" }, { "role": "copy" }, { "role": "paste" }, { "role": "pasteandmatchstyle" }, { "role": "delete" }, { "role": "selectall" }, { "role": null }, { "role": null }, { "role": null } ] }, { "role": "viewmenu", "subItems": [ { "role": "reload" }, { "role": "forcereload" }, { "role": "toggledevtools" }, { "role": null }, { "role": "resetzoom" }, { "role": "zoomin" }, { "role": "zoomout" }, { "role": null }, { "role": "togglefullscreen" } ] }, { "role": "windowmenu", "subItems": [ { "role": "minimize" }, { "role": "zoom" }, { "role": null }, { "role": "front" } ] }, { "role": "help", "subItems": [ { "role": null }, { "role": null }, { "role": null }, { "role": null } ] } ]
But comparing role with a lower cased string causes the following error.
This comparison appears to be unintentional because the types '"undo" | "redo" | "cut" | "copy" | "paste" | "pasteAndMatchStyle" | "delete" | "selectAll" | "reload" | "forceReload" | "toggleDevTools" | "resetZoom" | "zoomIn" | "zoomOut" | ... 29 more ... | "windowMenu"' and '"viewmenu"' have no overlap.
As defined in electron.d.ts role must be camel cased, so the returned menu by Menu.getApplicationMenu() seems wrong.
electron.d.ts
Menu.getApplicationMenu()
The text was updated successfully, but these errors were encountered:
ckerr
No branches or pull requests
Preflight Checklist
Electron Version
31.0.1
What operating system are you using?
macOS
Operating System Version
macOS Sonoma 14.5
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
Menu.getApplicationMenu() returns menu with valid roles.
Actual Behavior
As titled. Since this is TypeScript's type issue I created a Stackblitz project here for a reproduction.
https://stackblitz.com/~/github.com/takuyahara/electron-menu-issue?file=src/main.ts:L25
console.log in L17 results the following; every role is entirely lower case if exists.
But comparing role with a lower cased string causes the following error.
As defined in
electron.d.ts
role must be camel cased, so the returned menu byMenu.getApplicationMenu()
seems wrong.Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: