[TextField] update point to 0 or the lenght-1 on changes, fixes #150

This commit is contained in:
miguel
2018-12-01 12:37:14 -05:00
parent d16571fdc0
commit 137417f768
2 changed files with 2 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ static class Demo {
Y = Pos.Top (login),
Width = 40
};
var passText = new TextField ("") {
Secret = true,
X = Pos.Left (loginText),

View File

@@ -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;