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

v4: MenuItems with roles default registerAccelerator to false, breaking all default shortcuts #16303

Closed
pimterry opened this Issue Jan 7, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@pimterry
Copy link

pimterry commented Jan 7, 2019

  • Output of node_modules/.bin/electron --version: v4.0.1
  • Operating System (Platform and Version): Ubuntu 18.04

Expected Behavior
The default keyboard shortcuts for menu item roles should be registered (except in special cases where they're handled elsewhere - cut/copy/etc).

Actual behavior
As of v4, the keyboard shortcuts for any menu item with a role are not registered by default.

To Reproduce
In a v4 electron app, adding the below menu item will show a Ctrl/Cmd+R accelerator in the menu, but won't actually register it, so it won't work:

{
  role: 'reload'
}

this menu item does work:

{
  role: 'reload',
  registerAccelerator: true
}

I think this is caused by #15723, specifically

exports.shouldRegisterAccelerator = (role) => {
return roles.hasOwnProperty(role) ? roles[role].registerAccelerator : true
}

I.e. registerAccelerator defaults to true only if there's no role for the menu item. If there is a role set, it instead uses the registerAccelerator setting for that role, but for almost all roles this is undefined.

@welcome

This comment has been minimized.

Copy link

welcome bot commented Jan 7, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@codebytere

This comment has been minimized.

Copy link
Member

codebytere commented Jan 7, 2019

Ah, thanks for pointing this out! i'll see what can be done about it 😀

@codebytere

This comment has been minimized.

Copy link
Member

codebytere commented Jan 7, 2019

@pimterry a fix is in flight, it should go out with the next 4-0-x patch release i would guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment