joplin
joplin copied to clipboard
Accelerator not being added for menu
Environment
Joplin version: 2.8.8 Platform: Windows OS specifics: Windows 11 Home, Version 21H2
Steps to reproduce
- Create new Joplin command with
joplin.commands.register()
- Add menu item with
joplin.views.menuItems.create([id], [commandName], [location], { accelerator: [shortcut] })
The last menu item created does not have the accelerator added to it, despite being present in the menu. Note: any menu item except the last one created will have the accelerator (see screenshots below).
Describe what you expected to happen
Accelerator to be added to all menu items created.
Screenshots
Example 1: 2 menu items
Source:
joplin.plugins.register({
onStart: async function() {
await joplin.commands.register({
name: 'blankcommand1',
label: 'Blank Command 1',
execute: async () => {}
});
await joplin.commands.register({
name: 'blankcommand2',
label: 'Blank Command 2',
execute: async () => {}
});
await joplin.views.menuItems.create('Blank1', 'blankcommand1', MenuItemLocation.Tools, { accelerator: 'Ctrl+Alt+T' });
await joplin.views.menuItems.create('Blank2', 'blankcommand2', MenuItemLocation.Tools, { accelerator: 'Ctrl+Alt+L' });
},
});
Menu item:
Example 2: 3 menu items
Source:
joplin.plugins.register({
onStart: async function() {
await joplin.commands.register({
name: 'blankcommand1',
label: 'Blank Command 1',
execute: async () => {}
});
await joplin.commands.register({
name: 'blankcommand2',
label: 'Blank Command 2',
execute: async () => {}
});
await joplin.commands.register({
name: 'blankcommand3',
label: 'Blank Command 3',
execute: async () => {}
});
await joplin.views.menuItems.create('Blank1', 'blankcommand1', MenuItemLocation.Tools, { accelerator: 'Ctrl+Alt+A' });
await joplin.views.menuItems.create('Blank2', 'blankcommand2', MenuItemLocation.Tools, { accelerator: 'Ctrl+Alt+B' });
await joplin.views.menuItems.create('Blank3', 'blankcommand3', MenuItemLocation.Tools, { accelerator: 'Ctrl+Alt+C' });
},
});
Menu item:
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information.