angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.29k stars 6.73k forks source link

feat(typeahead): improve feel of arrow scrolling #6490

Open mikejacobson opened 7 years ago

mikejacobson commented 7 years ago

Currently, when using up- and down-arrows to scroll through typeahead matches when the matches list has a vertical scrollbar, the arrowed-to item is simply bumped to the top of the list, so you don't see your highlight moving down (or up) the list; this change provides a more intuitive UX in which the list container only scrolls when your arrowing reaches the bottom or top of the visible list.

Here's a plunk showing the current behavior: https://plnkr.co/edit/QEYzzerOfFW7bKJRCHfU?p=preview

Note that, as you arrow down, the selected item remains at the top of the list, so you don't see the highlight color moving down the list.

And here's one showing the (potential) new behavior: https://plnkr.co/edit/NuJuPqclSbZyLnCKCJSR?p=preview

As you arrow down, you see the highlight color move down the list as you would expect.