瀏覽代碼

Check if event was handled before in OnTextInput

temporaryuser0 7 年之前
父節點
當前提交
ad675ded5e
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/Avalonia.Controls/TextBox.cs

+ 5 - 2
src/Avalonia.Controls/TextBox.cs

@@ -275,8 +275,11 @@ namespace Avalonia.Controls
 
         protected override void OnTextInput(TextInputEventArgs e)
         {
-            HandleTextInput(e.Text);
-            e.Handled = true;
+            if (!e.Handled)
+            {
+                HandleTextInput(e.Text);
+                e.Handled = true;
+            }
         }
 
         private void HandleTextInput(string input)