electron: The "Zoom In" shortcut doesn't work
- Output of
node_modules/.bin/electron --version: 3.0.6, 4.0.0-beta.4 - Operating System (Platform and Version): Mac at least
- Output of
node_modules/.bin/electron --versionon last known working Electron version (if applicable): 2.0.11
Expected Behavior Behaviour in Electron 2:
- “View > Zoom In” menu item shows “⌘+” as a shortcut.
- Pressing “⌘+” increases a page’s zoom.
Actual behavior
- For Electron 3 the app “View” menu shows “⌘+” as a shortcut for the “Zoom In” item. For Electron 4 it shows “⇧⌘+”.
- The “⌘ and +” shortcut doesn’t work but “Shift and ⌘ and +” does the job in both Electron 3 and 4.
The other zoom shortcuts “⌘ and -” and “⌘ and 0” work as expected.
To Reproduce
Open any webpage in Electron, e.g. $ ...Electron.app/Contents/MacOS/Electron https://youtube.com, try to Zoom in and Zoom out with a keyboard.
Can be reproduced even with the default app.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 11
- Comments: 20 (5 by maintainers)
For now, I’m working around this issue with:
It restores the keyboard shortcut, which is used more frequently than the actual menu (for us, at least). The downside is it displays as ⌘= instead of ⌘+.
As mentioned here by @cbesangeeth This works for me 👇 (Linux, Ubuntu)
Zoom In : Ctrl Shift + Zoom Out : Ctrl -
This is still a problem. Electron 13.1.3
have to use Ctrl Shift + to get it to work…
@codebytere I think it would be better to support both ⌘+ & ⌘= in MacOS and display ⌘+ in the menu… This will also support both US and variants keyboard
Any update on this? I’m getting this error too. Directly clicking it through the menu will work though.
The Electron version reported on this issue is no longer supported. See our supported versions documentation.
If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know.
Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated.
This was actually fixed as a byproduct of #27701! <kbd>Cmd</kbd> and <kbd>+</kbd> (no shift key) triggers the same code path it used to trigger before Electron v3, zooming in the window as you would expect. This also works as expected on other keyboard layouts, e.g. French.
@codebytere Now that <kbd>Cmd</kbd> and <kbd>+</kbd> (no shift key) works without touching shortcuts, what to do with the <kbd>Cmd</kbd> and <kbd>Shift</kbd> and <kbd>=</kbd> shortcut lying around somewhere?
Reproducible on v8.0.0 too. We are using the
{ role: 'zoomin', accelerator: 'CommandOrControl+=' }workaround.I was trying to use that solution but I want it to display ⌘+. I tried duplicating the menu item and marking it as
visible: falsehowever that doesn’t work. Once the menu item is invisible it seems to be disabled even if I specifically enable it.I allow myself to reopen this issue as #15502 only fixes the display and not the shortcut itself.
Related: #14742