Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling a list widget that isn't at the top of the screen can result in an off-screen selected item #17

Closed
ktvoelker opened this issue Sep 17, 2015 · 4 comments

Comments

@ktvoelker
Copy link

The program I'm working on has a list widget, but above the list widget are a fixed number of lines of plain-old text. The presence of those header lines seems to screw up the scrolling/visibility logic a bit.

Terminal version: iTerm2 2.1.1 and Terminal 2.5.3 (both on OS X Yosemite)
GHC version: 7.10.2
brick version: 0.2
vty version: 5.4.0
A simple repro program: https://github.com/ktvoelker/brick-demo

Steps to reproduce:

  1. Run the program
  2. Press the Down key until the last visible item is selected.
  3. Press the Down key one more time.
  4. An item is selected which is not visible.

Expected behavior:
4. The list scrolls and the item becomes visible.

Note that if you press Down a few more times, eventually the list does start scrolling in the right direction. But it never catches up, so the selected item is always off-screen. The size of this "offset" appears to be equal to the number of lines of header text, plus one.

I would be glad to work on fixing the bug myself, but I wanted to make sure that it actually is a bug, first.

@jtdaugherty
Copy link
Owner

Thanks for the fantastic bug report. I've pushed a fix in a89df7b. Give it a try!

@ktvoelker
Copy link
Author

Works for me, thanks!

@jtdaugherty
Copy link
Owner

Okay. If this is resolved to your satisfaction, please close the ticket.

@jtdaugherty
Copy link
Owner

FYI, this fix has been released as part of 0.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants