Skip to content

WebView2 control steals focus from window and prevents bringing it to the front #22641

@ZedDevStuff

Description

@ZedDevStuff

Current behavior 🐛

Currently, clicking on a WebView2 control steals the focus from the window. It also doesn't allow you to bring the window to the front when clicked

Expected behavior 🎯

The window stays focused, and allows you to bring the window to the front when clicked if another app is in front of it, as is the case with other UI frameworks

How to reproduce it (as minimally and precisely as possible) 🔬

Just add a WebView to any desktop Uno app (Only tested on Windows, not sure if it happens on MacOS and Linux) and click inside it. Notice how the window is no longer focused

Workaround 🛠️

Call Window.Activate on each click inside the webview, which isn't easy to setup nor seamless since there will be a flicker on every click

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

No response

Uno.Sdk version (and other relevant versions) 📦

6.5.31

IDE version 🧑‍💻

Visual Studio 2026 Community 18.3.0

Anything else we need to know? 💬

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/untriagedIndicates an issue requires triaging or verification

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions