Use List height for scrolling with PgUp/PgDn

Fixes #417.
pull/418/head
Anatoli Babenia 4 years ago committed by GitHub
parent cd38d74324
commit 37ec5d08a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -499,9 +499,11 @@ func (l *List) InputHandler() func(event *tcell.EventKey, setFocus func(p Primit
case tcell.KeyEnd:
l.currentItem = len(l.items) - 1
case tcell.KeyPgDn:
l.currentItem += 5
_, _, _, height := l.GetInnerRect()
l.currentItem += height
case tcell.KeyPgUp:
l.currentItem -= 5
_, _, _, height := l.GetInnerRect()
l.currentItem -= height
case tcell.KeyEnter:
if l.currentItem >= 0 && l.currentItem < len(l.items) {
item := l.items[l.currentItem]

Loading…
Cancel
Save