microsoft / microsoft/microsoft-ui-xaml

Keydown event handler on a text area rendered in a Webview2 control not detecting '@' character on Finnish (and other) keyboard layouts.

Open
#10,284 3 comments 0 reactions 0 assignees View on GitHub
area-WebView bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

On Finnish keyboard the user needs to press "AltGr" & "2" key to enter the `@` character

Apparently in the keydown event listener on a textarea in Webview2 the `event.key` property never get's the correct value. This works in Edge browser though ...

### Steps to reproduce the bug

See here how Finnish keyboard produces '@' in Edge, but only '2' character in Webview2 in WinUI.

![Image](https://github.com/user-attachments/assets/c1d07756-e67e-4b30-aa89-f56191040b46)

Screenshot to show difference:
Image

Issue reproduces on other keyboard layouts as well from the moment `AltGraph` needs to be used.

### Expected behavior

The value of `event.key` should be '@' in WinUI / Webview2 as well.

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

### Windows version

Windows 11 (21H2): Build 22000

### Additional context

Using Microsoft.Web.WebView2 nuget package, version 1.0.2903.40

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the keydown behavior in a WinUI WebView2 control using a Finnish keyboard layout, then compare the resulting event.key value with Edge. Trace how AltGr-generated input reaches the textarea and confirm that the WebView2 path reports '@' rather than '2' before considering the issue complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.