TextBox.TextInput event is not fired
See original GitHub issueDescribe the bug When typing text into TextBox the event TextInput is not fired.
To Reproduce
- Generate new project based on “Avalonia .NET Core App”
- Open MainWindow.axaml and add TextBox with attached event handler to it:
<TextBox TextInput="InputElement_OnTextInput" />
- Define method at MainWindow.axaml.cs:
private void InputElement_OnTextInput(object? sender, TextInputEventArgs e)
{
throw new System.NotImplementedException();
}
- Run the project and type some text into textbox
- Note that text appears in the textbox and no exceptions happen:
Expected behavior Exception is thrown.
Desktop (please complete the following information):
- OS: linux, Pop!_OS 21.04
- Version 0.10.8
Additional information
I have tried to debug and found that TextInput event is marked as Handled
by TextBox. If we remove Handled = true then user handler is fired.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
WPF: Textbox not firing onTextInput event
Your handler for the TextInput event is not fired because the TextBox is handling the event. You could try using the TextChanged event...
Read more >#638 – PreviewTextInput Is Not Fired In Many Cases | 2,000 ...
You'd normally use the PreviewTextInput event to filter data being entered into a text-based control like the TextBox.
Read more >WPF: Textbox not firing onTextInput event
Your handler for the TextInput event is not fired because the TextBox is handling the event. You could try using the TextChanged event...
Read more >HTMLElement: input event - Web APIs | MDN
Note: The input event is fired every time the value of the element changes. This is unlike the change event, which only fires...
Read more >Text Input onchange event not firing after data load
Text Input onchange event not firing after data load. 10-02-2018 08:45 AM. I am customizing a SharePoint form that has a few text...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Our event system is heavily based on WPF (and by extension UWP) and so this behavior comes from there:
Closing as there are two another related issues.