Browse Source

Only sets the top if the sum (top + selected) is bigger than the frame height.

BDisp 4 years ago
parent
commit
b351b858ae
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Terminal.Gui/Views/ListView.cs

+ 3 - 1
Terminal.Gui/Views/ListView.cs

@@ -559,7 +559,9 @@ namespace Terminal.Gui {
 		{
 		{
 			if (source.Count > 0 && selected != source.Count - 1) {
 			if (source.Count > 0 && selected != source.Count - 1) {
 				selected = source.Count - 1;
 				selected = source.Count - 1;
-				top = selected;
+				if (top + selected > Frame.Height - 1) {
+					top = selected;
+				}
 				OnSelectedChanged ();
 				OnSelectedChanged ();
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();
 			}
 			}