Skip to content

Unexpected state after calling webview.focus() if webview is already focused #13697

Closed

Description

@magne4000
  • Electron Version: 2.0.5
  • Operating System (Platform and Version): macOS 10.13.5
  • Last known working Electron version: none that I could find

Expected Behavior
Calling webview.focus() should always have the same behavior, whatever the current state of the app.

Actual behavior
Calling webview.focus(), if the webview is blurred, does what we would expect (focus the webview and the document inside it).
Calling webview.focus(), if the webview is already focused, puts the webview in a strange state.
In the main window, document.activeElement is still the webview element, but inside the webview, document.hasFocus() now returns false (and we can see an outline around the webview)

To Reproduce
Details in this PR https://github.com/magne4000/electron-quick-start/pull/1

$ git clone https://github.com/magne4000/electron-quick-start.git -b webview-focus-issue
$ npm install
$ npm start || electron .

Activity

  1. added
    blocked/need-info ❌
    and removed
    blocked/need-info ❌
    on Jul 23, 2018
  2. sofianguy commented on Aug 9, 2019

    @sofianguy
    Contributor

    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 v4.2.x 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.

  3. added
    blocked/need-info ❌
    on Aug 9, 2019
  4. magne4000 commented on Aug 9, 2019

    @magne4000
    ContributorAuthor

    Doesn't seem to happen anymore

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2-0-xblocked/need-info ❌bug 🪲platform/macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions