From 9d4b79b7a917ec7320327d74e2059e4909861736 Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 31 May 2021 16:26:30 +0100 Subject: [PATCH 1/2] Fixes #1326. Prevent selected item to be equal to the source count. --- Terminal.Gui/Views/ListView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs index a7c800261..efaf926ad 100644 --- a/Terminal.Gui/Views/ListView.cs +++ b/Terminal.Gui/Views/ListView.cs @@ -468,7 +468,7 @@ namespace Terminal.Gui { public virtual bool MovePageDown () { var n = (selected + Frame.Height); - if (n > source.Count) + if (n > source.Count - 1) n = source.Count - 1; if (n != selected) { selected = n; From fc5cb56fe0212d1282c053b4ed562de79d298a80 Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 31 May 2021 16:48:13 +0100 Subject: [PATCH 2/2] Changing to the @tznind suggestion. --- Terminal.Gui/Views/ListView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs index efaf926ad..5d56a408c 100644 --- a/Terminal.Gui/Views/ListView.cs +++ b/Terminal.Gui/Views/ListView.cs @@ -468,7 +468,7 @@ namespace Terminal.Gui { public virtual bool MovePageDown () { var n = (selected + Frame.Height); - if (n > source.Count - 1) + if (n >= source.Count) n = source.Count - 1; if (n != selected) { selected = n;