You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there are further items off screen, PgDn will move down to select the next set of items, but when there are no further items, PgDn will do the inverse and select the first item, instead of selecting the last item.
Similarly, when there are previous items off screen, PgUp will move up to select the previous set of items, but when there are no further items, PgUp will do the inverse and select the last item, instead of selecting the first item
This gets particularly confusing in the common case where all items fit on the screen - PgDn always selects the first item, while PgUp always selects the last item - which is opposite of what people are expecting.
The text was updated successfully, but these errors were encountered:
berrange
added a commit
to berrange/tview
that referenced
this issue
Mar 15, 2021
Consider a list with 5 items, and the currentItem index is 2, and
all items fit on the screen without scrolling.
KeyPgDn will set currentItem to 7 which is out of bounds, and
gets wrapped around to 0.
KeyPgUp will set currentItem to -3 which is out of bounds, and
gets wrapped around to 4.
Thus PgDn selects the first item, while PgUp selects the last item,
which is the opposite of expected behaviour for these keys. Fix
this by clamping currentItem to the boundaries in the key handler.
Fixes: rivo#580
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Consider a list with 5 items, and the currentItem index is 2, and
all items fit on the screen without scrolling.
KeyPgDn will set currentItem to 7 which is out of bounds, and
gets wrapped around to 0.
KeyPgUp will set currentItem to -3 which is out of bounds, and
gets wrapped around to 4.
Thus PgDn selects the first item, while PgUp selects the last item,
which is the opposite of expected behaviour for these keys. Fix
this by clamping currentItem to the boundaries in the key handler.
Fixes: rivo/tview#580
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
When there are further items off screen, PgDn will move down to select the next set of items, but when there are no further items, PgDn will do the inverse and select the first item, instead of selecting the last item.
Similarly, when there are previous items off screen, PgUp will move up to select the previous set of items, but when there are no further items, PgUp will do the inverse and select the last item, instead of selecting the first item
This gets particularly confusing in the common case where all items fit on the screen - PgDn always selects the first item, while PgUp always selects the last item - which is opposite of what people are expecting.
The text was updated successfully, but these errors were encountered: