Skip to content

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

Closed

Description

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).

Activity

  1. added
    bug
    macos
    webview
    on Dec 10, 2018
  2. mjbvz commented on Dec 19, 2018

    @mjbvz
    Contributor

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

  3. bpasero commented on Dec 19, 2018

    @bpasero
    ContributorAuthor

    Matt Bierner (@mjbvz) that was my previous solution but it lead to Daniel Imms (@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.

  4. mjbvz commented on Dec 19, 2018

    @mjbvz
    Contributor

    SteVen Batten (@sbatten) Suggested that #64228 may also be of interest

  5. bpasero commented on Dec 20, 2018

    @bpasero
    ContributorAuthor

    Matt Bierner (@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.

  6. bpasero commented on Dec 20, 2018

    @bpasero
    ContributorAuthor

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

  7. added
    verified
    on Feb 1, 2019
  8. locked and limited conversation to collaborators on Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugmacosverifiedwebview

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions