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

This commit is contained in:
BDisp
2021-06-02 16:47:07 +01:00
parent 2ba1a50f2e
commit b351b858ae

View File

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