diff --git a/Terminal.Gui/View/View.Navigation.cs b/Terminal.Gui/View/View.Navigation.cs index 5936dec9e..6af1262fa 100644 --- a/Terminal.Gui/View/View.Navigation.cs +++ b/Terminal.Gui/View/View.Navigation.cs @@ -429,11 +429,11 @@ public partial class View // Focus and cross-view navigation management (TabStop // We're moving beyond the last subview // Determine if focus should remain in this focus chain, or move to the superview's focus chain - // - If we are TabStop and our SuperView is TabStop move to superview's focus chain - if (TabStop == TabBehavior.TabStop && SuperView is { TabStop: TabBehavior.TabStop }) - { - return false; - } + //// - If we are TabStop and our SuperView is TabStop move to superview's focus chain + //if (TabStop == TabBehavior.TabStop && SuperView is { TabStop: TabBehavior.TabStop }) + //{ + // return false; + //} // - If we are TabStop and our SuperView has at least one other TabStop subview, move to the SuperView's chain if (TabStop == TabBehavior.TabStop && SuperView is { } && SuperView.GetScopedTabIndexes (direction, behavior).Length > 1) diff --git a/UnitTests/Views/ColorPickerTests.cs b/UnitTests/Views/ColorPickerTests.cs index f87fd45b3..5d43b9643 100644 --- a/UnitTests/Views/ColorPickerTests.cs +++ b/UnitTests/Views/ColorPickerTests.cs @@ -336,8 +336,10 @@ public class ColorPickerTests View otherView = new View () { CanFocus = true }; Application.Current?.Add (otherView); // thi sets focus to otherView + Assert.True (otherView.HasFocus); cp.SetFocus (); + Assert.False (otherView.HasFocus); cp.Draw (); @@ -362,9 +364,11 @@ public class ColorPickerTests // Change value using text field TextField rBarTextField = cp.Subviews.OfType ().First (tf => tf.Text == "0"); + rBarTextField.SetFocus (); rBarTextField.Text = "128"; otherView.SetFocus (); + Assert.True (otherView.HasFocus); cp.Draw (); @@ -429,7 +433,7 @@ public class ColorPickerTests cp.Draw (); // Click on Green bar - Application.OnMouseEvent(new () + Application.OnMouseEvent (new () { Flags = MouseFlags.Button1Pressed, Position = new (0, 1)