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 "Zoom In" shortcut doesn't work #15496

Closed
alexeykuzmin opened this issue Oct 31, 2018 · 20 comments · Fixed by #15502
Closed

The "Zoom In" shortcut doesn't work #15496

alexeykuzmin opened this issue Oct 31, 2018 · 20 comments · Fixed by #15502
Assignees

Comments

@alexeykuzmin
Copy link
Contributor

alexeykuzmin commented Oct 31, 2018

  • 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 --version on last known working Electron version (if applicable): 2.0.11

Expected Behavior
Behaviour in Electron 2:

  1. "View > Zoom In" menu item shows "⌘+" as a shortcut.
  2. Pressing "⌘+" increases a page's zoom.

Actual behavior

  1. For Electron 3 the app "View" menu shows "⌘+" as a shortcut for the "Zoom In" item.
    For Electron 4 it shows "⇧⌘+".
  2. 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.

@alexeykuzmin
Copy link
Contributor Author

/cc @brenca for the menu issues

@alexstrat
Copy link
Contributor

I allow myself to reopen this issue as #15502 only fixes the display and not the shortcut itself.

Related: #14742

@alexstrat alexstrat reopened this Nov 14, 2018
@javan
Copy link
Contributor

javan commented Dec 31, 2018

For now, I'm working around this issue with:

     { role: 'resetzoom' },
-    { role: 'zoomin' },
+    { role: 'zoomin', accelerator: 'CommandOrControl+=' },
     { role: 'zoomout' },

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 ⌘+.

@aaronraimist
Copy link

I was trying to use that solution but I want it to display ⌘+. I tried duplicating the menu item and marking it as visible: false however that doesn't work. Once the menu item is invisible it seems to be disabled even if I specifically enable it.

{ role: 'zoomin' },
{ 
    role: 'zoomin', 
    accelerator: 'CommandOrControl+=',
    visible: false,
    enabled: true,
},

@mx2323
Copy link

mx2323 commented Jan 8, 2020

just hit this - does anyone have a real fix or know why this doesnt work? im reverting back to 2.0.11 for now.

@electron-triage
Copy link

Thank you for taking the time to report this issue and helping to make Electron better.

The version of Electron you reported this on has been superseded by newer releases.

If you're still experiencing this issue in Electron 6.x.y or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.

I'm setting the blocked/need-info label for the above reasons. This issue will be closed 7 days from now if there is no response.

Thanks in advance! Your help is appreciated.

@electron-triage electron-triage added the blocked/need-info ❌ Cannot proceed without more information label Feb 19, 2020
@dsteinman
Copy link

This problem still appears to be unresolved as of v7.1.12.

@bigshahan
Copy link

Reproducible on v8.0.0 too. We are using the { role: 'zoomin', accelerator: 'CommandOrControl+=' } workaround.

@codebytere
Copy link
Member

codebytere commented Mar 25, 2020

Due to the way that Apple's keyboard shortcuts work here, there are two options moving forward:

  1. Display the menu item with ⌘=, so that only two keys are needed to trigger.
  2. Correct the current item to reflect that it needs to be triggered with ⇪⌘+; current trigger key combo remains unchanged.

What would you all prefer?

@danutzcodrescu
Copy link

I would say option 1. It would be more intuitive to press.

@KiranNiranjan
Copy link

@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

@clavin
Copy link
Member

clavin commented Feb 19, 2021

This was actually fixed as a byproduct of #27701! Cmd and + (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 Cmd and + (no shift key) works without touching shortcuts, what to do with the Cmd and Shift and = shortcut lying around somewhere?

@electron-triage
Copy link

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.

@nikhilmishra11
Copy link

Getting zoom in issue,
Zoom in ctrl+ then pressing the next button and loading the new page. After the new page loaded, ctrl- is not working.
For making it work, I have to first press ctrl+ then zoom out is working again on ctrl-.

@tr3ysmith
Copy link

This is still a problem.
Electron 13.1.3

have to use Ctrl Shift + to get it to work....

@Paxxous
Copy link

Paxxous commented Feb 24, 2022

It hasn't been working for me either. Can't seem to find a fix. Not even manually zooming in through the top menu seems to work. And every time I reboot my app the zoom saves.

@J-N-R
Copy link

J-N-R commented Apr 18, 2023

Any update on this? I'm getting this error too. Directly clicking it through the menu will work though.

@bradisbell
Copy link

Still an issue, in Electron 24.2.0 on Windows.

@bradisbell
Copy link

Still an issue, in Electron 25.1.0 on Windows.

@julian-alarcon
Copy link

As mentioned here by @cbesangeeth
This works for me 👇 (Linux, Ubuntu)

Zoom In : Ctrl Shift +
Zoom Out : Ctrl -

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

Successfully merging a pull request may close this issue.