Tig hace 11 meses
padre
commit
66f4bef512
Se han modificado 2 ficheros con 10 adiciones y 1 borrados
  1. 6 0
      Terminal.Gui/View/View.Navigation.cs
  2. 4 1
      Terminal.Gui/Views/ComboBox.cs

+ 6 - 0
Terminal.Gui/View/View.Navigation.cs

@@ -131,6 +131,12 @@ public partial class View // Focus and cross-view navigation management (TabStop
             }
             }
         }
         }
 
 
+        if (_hasFocus)
+        {
+            // Something else beat us to the change (likely a FocusChanged handler).
+            return (true, false);
+        }
+
         // By setting _hasFocus to true we definitively change HasFocus for this view.
         // By setting _hasFocus to true we definitively change HasFocus for this view.
 
 
         // Get whatever peer has focus, if any
         // Get whatever peer has focus, if any

+ 4 - 1
Terminal.Gui/Views/ComboBox.cs

@@ -414,7 +414,10 @@ public class ComboBox : View, IDesignable
 
 
     private bool CancelSelected ()
     private bool CancelSelected ()
     {
     {
-        _search.SetFocus ();
+        if (HasFocus)
+        {
+            _search.SetFocus ();
+        }
 
 
         if (ReadOnly || HideDropdownListOnClick)
         if (ReadOnly || HideDropdownListOnClick)
         {
         {