question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextBox.TextInput event is not fired

See original GitHub issue

Describe the bug When typing text into TextBox the event TextInput is not fired.

To Reproduce

  1. Generate new project based on “Avalonia .NET Core App”
  2. Open MainWindow.axaml and add TextBox with attached event handler to it: <TextBox TextInput="InputElement_OnTextInput" />
  3. Define method at MainWindow.axaml.cs:
        private void InputElement_OnTextInput(object? sender, TextInputEventArgs e)
        {
            throw new System.NotImplementedException();
        }
  1. Run the project and type some text into textbox
  2. Note that text appears in the textbox and no exceptions happen: image

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. image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
grokyscommented, Oct 13, 2021
0reactions
maxkatz6commented, Oct 13, 2021

Closing as there are two another related issues.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found