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

macOS: certain commands executed twice when focus is in webview #64724

Closed
bpasero opened this issue Dec 10, 2018 · 5 comments
Closed

macOS: certain commands executed twice when focus is in webview #64724

bpasero opened this issue Dec 10, 2018 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug macos Issues with VS Code on MAC/OS X verified Verification succeeded webview Webview issues

Comments

@bpasero
Copy link
Member

bpasero commented Dec 10, 2018

Extracted from #56988 (comment)

When invoking a keybinding that also exists on the macOS native menu, while having focus inside a webview, the command is both triggered through the menu and our keybinding forwarder (here).

It looks like we could possibly use webContents.setIgnoreMenuShortcuts(true) to workaround this, but then any menu that is implemented with a :role will not work (e.g. cut, copy, paste).

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug macos Issues with VS Code on MAC/OS X webview Webview issues electron-3.0.x-update labels Dec 10, 2018
@mjbvz mjbvz added this to the December/January 2019 milestone Dec 18, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Dec 19, 2018

I wonder if we can use the before-input-event here to avoid having the listener in the webview

@bpasero
Copy link
Member Author

bpasero commented Dec 19, 2018

@mjbvz that was my previous solution but it lead to @Tyriar bug that keybindings are not working on Windows. The problem is that the before-input-event does not carry all the keybinding information around that is needed for us to replicate the event on the main side.

Nevertheless, even before when I used before-input-event we were suffering from this bug.

@mjbvz
Copy link
Collaborator

mjbvz commented Dec 19, 2018

@sbatten Suggested that #64228 may also be of interest

@mjbvz mjbvz closed this as completed in 8a58c3e Dec 19, 2018
@bpasero
Copy link
Member Author

bpasero commented Dec 20, 2018

@mjbvz with your change, any command that is implemented with a :role does not work anymore inside the webview. For example, try to Cmd+C or undo/redo in an input field, it will not work because these commands only worked through the menu.

@bpasero bpasero reopened this Dec 20, 2018
@bpasero
Copy link
Member Author

bpasero commented Dec 20, 2018

Actually since this issue is addressed, let's move that new issue to #65452

@bpasero bpasero closed this as completed Dec 20, 2018
@roblourens roblourens added the verified Verification succeeded label Feb 1, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug macos Issues with VS Code on MAC/OS X verified Verification succeeded webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants