mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Discovered serious issues with how HasFocus, OnEnter/OnLeave, etc... work in some edge cases.
This will require re-visiting the design at a deep level and fixing some long-standing but ignored issues such as how OnEnter/OnLeave don't follow proper cancelation design. Also, there's a need for keeping track of the old focus state of a tree of subviews when that tree loses focus; FocusDireciton is a hack that causes tons of confusion.
This commit is contained in:
@@ -78,7 +78,7 @@ public class TextFieldTests (ITestOutputHelper output)
|
||||
public void Cancel_TextChanging_ThenBackspace ()
|
||||
{
|
||||
var tf = new TextField ();
|
||||
tf.RestoreFocus ();
|
||||
tf.RestoreFocus (null);
|
||||
tf.NewKeyDownEvent (Key.A.WithShift);
|
||||
Assert.Equal ("A", tf.Text);
|
||||
|
||||
@@ -929,7 +929,7 @@ public class TextFieldTests (ITestOutputHelper output)
|
||||
public void Backspace_From_End ()
|
||||
{
|
||||
var tf = new TextField { Text = "ABC" };
|
||||
tf.RestoreFocus ();
|
||||
tf.RestoreFocus (null);
|
||||
Assert.Equal ("ABC", tf.Text);
|
||||
tf.BeginInit ();
|
||||
tf.EndInit ();
|
||||
@@ -956,7 +956,7 @@ public class TextFieldTests (ITestOutputHelper output)
|
||||
public void Backspace_From_Middle ()
|
||||
{
|
||||
var tf = new TextField { Text = "ABC" };
|
||||
tf.RestoreFocus ();
|
||||
tf.RestoreFocus (null);
|
||||
tf.CursorPosition = 2;
|
||||
Assert.Equal ("ABC", tf.Text);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user