mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
[TextField] update point to 0 or the lenght-1 on changes, fixes #150
This commit is contained in:
@@ -106,6 +106,7 @@ static class Demo {
|
||||
Y = Pos.Top (login),
|
||||
Width = 40
|
||||
};
|
||||
|
||||
var passText = new TextField ("") {
|
||||
Secret = true,
|
||||
X = Pos.Left (loginText),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user