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

Button should check RoutedEventArgs.Source before handling keys #16184

Open
amwx opened this issue Jul 1, 2024 · 0 comments
Open

Button should check RoutedEventArgs.Source before handling keys #16184

amwx opened this issue Jul 1, 2024 · 0 comments

Comments

@amwx
Copy link
Contributor

amwx commented Jul 1, 2024

Describe the bug

Reported in amwx/FluentAvalonia#591.

Placing a text control into an Expander header does not allow spaces. The cause is the Button that is found in the Expander's header (which is part of the template for my SettingsExpander control in the referenced issue) is consuming this event and the TextBox never sees it.

I looked at WPF source, they do a check in ButtonBase to see if the event source is the button and only handle it in that case - Avalonia should do the same check.

https://github.com/dotnet/wpf/blob/0628a7722ccdc47ebe66beb5eb8cee756d05f7d9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/ButtonBase.cs#L612-L647

To Reproduce

Add a TextBox to an Expander and try to type text with spaces. Only the text will be entered, the space key will open/close the expander.

Expected behavior

No response

Avalonia version

11.1-rc1

OS

Windows

Additional context

No response

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

No branches or pull requests

2 participants