Skip to content
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

The default options like 'cut' 'copy' 'paste', etc. don't show accelerators next to them #171

Open
ygshbht opened this issue Aug 23, 2023 · 5 comments

Comments

@ygshbht
Copy link

ygshbht commented Aug 23, 2023

The default options like 'cut' 'copy' 'paste', etc. don't show accelerators next to them. It would be better if there is an option like there is for labels. Otherwise you need to modify the menu property which is complex and could mess up the order.

@sindresorhus
Copy link
Owner

What OS did you expect them to show? On macOS, context menus should not have any accelerators. Last time I checked, this applied to Windows too.

@ygshbht
Copy link
Author

ygshbht commented Aug 23, 2023

Thank you.

Any OS, but yes, MacOS is the main focus here. Right now in Linux, in Chrome iteself or even VSCode, if i right click, i see the acceleartor next to the names.

Even doing this with electron-context-menu shows the accelerators

contextMenu({
    append: (defaultActions, parameters, browserWindow) => [
        new MenuItem({
            // Only enable the menu item for Editable context which supports paste
            visible: parameters.isEditable && parameters.editFlags.canPaste,
            role: 'pasteAndMatchStyle',
            accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AND_MATCH_STYLE,
        }),
        new MenuItem({
            label: Localize.translate(CONST.LOCALES.DEFAULT, 'desktopApplicationMenu.pasteAsPlainText'),
            visible: parameters.isEditable && parameters.editFlags.canPaste && clipboard.readText().length > 0,
            accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AS_PLAIN_TEXT,
            click: () => pasteAsPlainText(browserWindow),
        }),
    ],
});

@ygshbht
Copy link
Author

ygshbht commented Aug 23, 2023

How about doing this if you want to go ahead with the proposal?

ygshbht@6e74a48

@sindresorhus
Copy link
Owner

Right now in Linux, in Chrome iteself or even VSCode

Chrome and VS Code are not very good at adhering to platform conventions.

@sindresorhus
Copy link
Owner

I'm not interested in supporting something that breaks platform conventions. If you can prove that a certain OS always uses accelerators in context menus, I may consider it for that platform, but it will never be supported on macOS. Electron apps get a lot of bad reputation for apps feeling non-native and I'm not going to help apps continue this trend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants