Explorar o código

Merge pull request #3427 from BDisp/v1_force-focus-fix_3424

Fixes #3424. v1 - Views should not force focus if they are not selected.
Tig hai 1 ano
pai
achega
4b69a02890

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

@@ -792,7 +792,7 @@ namespace Terminal.Gui {
 			listview.SetSource (searchset);
 			listview.Height = CalculatetHeight ();
 
-			if (Subviews.Count > 0) {
+			if (HasFocus && Subviews.Count > 0) {
 				search.SetFocus ();
 			}
 		}

+ 4 - 0
Terminal.Gui/Windows/Wizard.cs

@@ -773,6 +773,10 @@ namespace Terminal.Gui {
 			var oldStep = currentStep;
 			currentStep = newStep;
 
+			if (currentStep is null) {
+				return false;
+			}
+
 			UpdateButtonsAndTitle ();
 
 			// Set focus to the nav buttons

+ 4 - 0
UnitTests/Views/ViewTests.cs

@@ -1246,6 +1246,10 @@ namespace Terminal.Gui.ViewTests {
 
 			Application.Run ();
 
+			// Ensures cleaning any keystroke.
+			// This was conflicting with the TestVKPacket unit test
+			Console.MockKeyPresses.Clear ();
+
 			// Shutdown must be called to safely clean up Application if Init has been called
 			Application.Shutdown ();
 		}