Skip to content

WebView2 WinForms control in Excel VSTO Task pane steals and holds on to keyboard focus #951

Open
@ShaunLoganOracle

Description

@ShaunLoganOracle

Description
I have a Winforms WebView2 hosted in an Excel VSTO Task pane, There is no System.Windows.Forms.Form hosting the WebView2 control, instead, a System.Windows.Forms.UserControl is the owner/host of the control. After giving the WebView2 focus, it holds on to it after I've clicked back into the Excel worksheet.

Version
SDK: 1.0.705.50
Runtime: Evergreen RT 88.0.705.68
Framework: WinForms
OS: Win10 1909

Repro Steps

  1. Render some fairly simple static HTML in the WebView2
  2. Click in a worksheet cell, verify that keystrokes are acted on there (eg. right-arrow moves selected cell)
  3. Click in the HTML content in the WebView2 (in the task pane), verify that keystrokes are acted on there (eg. Enter toggles an expand/collapse widget)
  4. Click back in a different worksheet cell
    Observed: selected cell is changed as expected, however keystrokes are still getting captured by WebView2 (ie. Enter toggles the HTML widget instead of moving the cell selection).

AB#36775741

Metadata

Metadata

Labels

In-progressDev work in progress and will update when there's progress.bugSomething isn't workingtrackedWe are tracking this work internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions