mirror of
https://github.com/rivo/tview.git
synced 2025-04-24 13:48:56 +08:00
Merge pull request #418 from abitrolly/patch-2
Use List height for scrolling with PgUp/PgDn
This commit is contained in:
commit
ba71c7df7c
6
list.go
6
list.go
@ -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…
x
Reference in New Issue
Block a user