You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been debugging this for longer than I'd care to admit.. I have a custom menu config like so:
{label: "Zoom in",role: "zoomIn",accelerator: "CmdOrCtrl+Plus",click: function(_item,focusedWindow): void{// do stuff},},{label: "Zoom out",role: "zoomOut",accelerator: "CmdOrCtrl+-",click: function(_item,focusedWindow): void{// do stuff},},{label: "Reset Zoom",role: "resetZoom",accelerator: "CmdOrCtrl+0",click: function(_item,focusedWindow): void{// do stuff},},
Both "zoom in" and "reset zoom" worked as expected but "zoom out" did not. I changed the accelerator to other combinations and it would work and I was at a loss until I searched through my code for "shortcut", the optimizer.watchWindowShortcuts(window) came up. I must have misunderstood the purpose of the method because I didn't think it affected zooming until I searched the source code.
I think the logic here is incorrect such that if you use the suggestion in the docs: optimizer.watchWindowShortcuts(window) it incorrectly disables zoom out or CmdOrCtrl+-
If I set zoom to false everything works as expected:
Also, interestingly I was forced to have the escToCloseWindow option there because of a TypeScript issue:
For what it's worth, using CmdOrCtrl+numsub wasn't affected by this issue.
Ultimately I don't think I'll actually use this method at all because my app doesn't need those things disabled, but I thought I should report it anyway.
Describe the bug
I have been debugging this for longer than I'd care to admit.. I have a custom menu config like so:
Both "zoom in" and "reset zoom" worked as expected but "zoom out" did not. I changed the
accelerator
to other combinations and it would work and I was at a loss until I searched through my code for "shortcut", theoptimizer.watchWindowShortcuts(window)
came up. I must have misunderstood the purpose of the method because I didn't think it affected zooming until I searched the source code.I think the logic here is incorrect such that if you use the suggestion in the docs:
optimizer.watchWindowShortcuts(window)
it incorrectly disables zoom out orCmdOrCtrl+-
If I set
zoom
tofalse
everything works as expected:Also, interestingly I was forced to have the
escToCloseWindow
option there because of a TypeScript issue:For what it's worth, using
CmdOrCtrl+numsub
wasn't affected by this issue.Ultimately I don't think I'll actually use this method at all because my app doesn't need those things disabled, but I thought I should report it anyway.
Electron-Toolkit Version
3.0.0
Electron Version
32.1.0
Validations
The text was updated successfully, but these errors were encountered: