From b40496f568c1e25e7effd9cdd42e70b5f844c0e1 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 5 Feb 2020 11:08:32 +0000 Subject: [PATCH] Fixed a bug when selecting the first row in a ListBox after a key down event --- modules/juce_gui_basics/widgets/juce_ListBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.cpp b/modules/juce_gui_basics/widgets/juce_ListBox.cpp index 75c4545ddf..7d7a9833f6 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ListBox.cpp @@ -723,7 +723,7 @@ bool ListBox::keyPressed (const KeyPress& key) if (multiple) selectRangeOfRows (lastRowSelected, lastRowSelected + 1); else - selectRow (jmin (totalItems - 1, jmax (0, lastRowSelected) + 1)); + selectRow (jmin (totalItems - 1, jmax (0, lastRowSelected + 1))); } else if (key.isKeyCode (KeyPress::pageUpKey)) {