diff --git a/Example/demo.cs b/Example/demo.cs index d36621011..7b86e62ea 100755 --- a/Example/demo.cs +++ b/Example/demo.cs @@ -106,6 +106,7 @@ static class Demo { Y = Pos.Top (login), Width = 40 }; + var passText = new TextField ("") { Secret = true, X = Pos.Left (loginText), diff --git a/Terminal.Gui/Views/TextField.cs b/Terminal.Gui/Views/TextField.cs index 86606676e..d43b1e72c 100644 --- a/Terminal.Gui/Views/TextField.cs +++ b/Terminal.Gui/Views/TextField.cs @@ -95,7 +95,7 @@ namespace Terminal.Gui { set { text = TextModel.ToRunes (value); if (point > text.Count) - point = text.Count; + point = Math.Max (text.Count-1, 0); // FIXME: this needs to be updated to use Rune.ColumnWidth first = point > Frame.Width ? point - Frame.Width : 0;