MicrosoftEdge / MicrosoftEdge/WebView2Feedback

WPF - Tabcontrol - focus problem (activeElement)

Open
#2,106 1 comment 0 reactions 1 assignee View on GitHub

@champnic is already working on this.

Since Jan 28, 2022.

bug tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Hello,

I'm using multiple webviews2 inside a WPF tabcontrol, one webview per tabitem
When you switch tab, the focus inside the webview is lost.
The webview still have keyboardfocus but the activeElement is not the same.

SDK: 1.0.1133-prerelease
Runtime: edge 97.0.1072.69
Framework: WPF
OS: WIN 10

You can reproduce this in the webview2 sample, WebView2WpfBrowser project for example.

Simply replace the single webview by a tabcontrol with 2 webview :

<TabControl Name="tabControl">
                <TabItem Header="webview1">
                    <wv2:WebView2 x:Name="webView" CreationProperties="{StaticResource EvergreenWebView2CreationProperties}" Source="https://www.bing.com/"/>
                </TabItem>
                <TabItem Header="webview2">
                    <wv2:WebView2 x:Name="webView2" CreationProperties="{StaticResource EvergreenWebView2CreationProperties}" Source="https://www.bing.com/"/>
                </TabItem>
</TabControl>

Focus the bing searchbar, switch to tab2, switch back to tab1; focus is not inside the searchbar anymore.

Regards

AB#36775741

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.