mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #217] Do not scroll List items unless selected item is out of view #167
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#167
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ardnew on GitHub (Jan 3, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/217
When navigating a
Listwith more items than can fit on screen, theDrawroutine tries to simulate a scrolling effect. However, this scrolling only works as expected in one direction -- when you scroll down.When the user scrolls the list downward, the bottom-most item is highlighted/selected as the prior items scroll upward out of view as expected.
When the user scrolls the list upward, the bottom-most item is still highlighted/selected as the prior items scroll downward out of view, which is not what I think most people would expect.
For comparison, consider any given text editor. If your cursor is on the bottom-most row of the editor view, and you press the
Upkey on your keyboard, the cursor moves upward and the items visible on screen remain stationary until the cursor reaches the top of the screen -- at which point the whole relationship should happen in reverse.Basically, unless the user's currently selected item is outside the range of visible items, the view should not be scrolling at all.
@rivo commented on GitHub (Jan 23, 2019):
See also https://github.com/rivo/tview/pull/218#issuecomment-456959828.