Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Page Up/Down work oddly in dropdowns without scrollbars #8433

Closed
peterflynn opened this issue Jul 17, 2014 · 4 comments
Closed

Page Up/Down work oddly in dropdowns without scrollbars #8433

peterflynn opened this issue Jul 17, 2014 · 4 comments

Comments

@peterflynn
Copy link
Member

  1. Open the Find in Files filter dropdown, or the status bar language picker dropdown
  2. Hover over any random item in the list
  3. Press Page Up or Page Down repeatedly

Result: Selection alternates between the first and last item in the list forever. Nothing else ever gets selected.

Expected: Either do nothing or act like Home/End instead of jumping around (the latter is how native dropdowns appear to work on Windows).

Side note -- it also looks like DropdownEventHandler._itemsPerPage() won't work right when there are any dividers in the list (indeed, you can't return a single result that's true for all "pages" of items, since their height isn't constant). The only dropdowns we currently use dividers on are too short to scroll, but that's not guaranteed forever -- so we might want to clean up the other Page Up/Down codepath too...

@peterflynn
Copy link
Member Author

Also, if you skip step 2 and thus have nothing highlighted initially, step 3 always highlights the last item in the list on first keypress, regardless of whether you pressed Page Up or Page Down... which also feels weird.

@marcelgerber
Copy link
Contributor

Btw, Home/End doesn't even work in dropdowns right now.

@peterflynn
Copy link
Member Author

After playing with this a bit, I think the right answer here is to make Page Up/Down not wrap around the edges of the list -- they should just clip and stop at whatever end they're headed toward. The overshoot you get from wrapping is weird, and I can't find any other app where they wrap at all. If we make that change, it would also make PgUp/Dn automatically act like Home/End in the no-scrollbar case, which I think is good.

@peterflynn peterflynn self-assigned this Jul 18, 2014
peterflynn added a commit that referenced this issue Jul 18, 2014
…e doc's

current language is already the default (i.e. there's no path-specific override).

DropdownButton changes:
* Support disabled items
* Fix bug #8433 (Page Up/Down work oddly) - Only wrap around to other end
of list when using arrow keys. Page Up/Down 'stick' at start/end of list
instead (so they will act like Home/End when there's no scrollbar).
* Add Home/End key support
@peterflynn
Copy link
Member Author

Fixed now that PR #8444 has landed

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

No branches or pull requests

3 participants