Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tunneling KeyDown Event not fired if TextBox has input Focus #15727

Closed
mikeyusc opened this issue May 14, 2024 · 2 comments
Closed

Tunneling KeyDown Event not fired if TextBox has input Focus #15727

mikeyusc opened this issue May 14, 2024 · 2 comments
Labels

Comments

@mikeyusc
Copy link

mikeyusc commented May 14, 2024

Describe the bug

If a TextBox has input Focus, keypresses that generate TextInput events are not fired as KeyDown events as well. Keypresses that do not generate TextInput events do fire KeyDown events (Tunnel)
This only seems to happen on macOS, Windows & Linux function correctly.

To Reproduce

MyText is a Vanilla TextBox

/* Does not appear to ever be invoked for Keys that cause TextInput*/
MyText.AddHandler(KeyDownEvent, (sender, args) =>
{
    Debugger.Break();
}, RoutingStrategies.Tunnel);

Expected behavior

I expect that the KeyDown events will fire for every keystroke, as they do on Windows & Linux.

Avalonia version

11.1.0-beta2

OS

macOS

Additional context

AvaloniaTest.zip

@mikeyusc mikeyusc added the bug label May 14, 2024
@IanRawley
Copy link
Contributor

IanRawley commented May 14, 2024

This also happens on Android.

At least in the Android case, this appears to be caused at the Xamarin level due to IME handling. As a result I decided that it was likely not something Avalonia actually had much control over, and so didn't file a bug and instead started working on alternatives for my use case.

@mikeyusc
Copy link
Author

So this appears to have been broken in 26035be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants