Skip to content

Commit

Permalink
Wpf: Fix dispatcher error when cancelling a TextBox TextChanging event
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensley committed Nov 29, 2023
1 parent 015f78b commit d0b0595
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Eto.Wpf/Forms/Controls/TextBoxHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ public string Text
var args = new TextChangingEventArgs(oldText, newText, false);
Callback.OnTextChanging(Widget, args);
if (args.Cancel)
{
TextBox.EndChange();
return;
}

var needsTextChanged = TextBox.Text == newText;

// Improve performance when setting text often
Expand Down

0 comments on commit d0b0595

Please sign in to comment.