issa-tseng / awesomecomplete

A lightweight autocomplete plugin for jQuery. Autocomplete that doesn't suck — I think.
http://dontexplain.com/2009/08/jquery-plugin-lautocomplete/
52 stars 7 forks source link

Add support for clipping the result list and scrolling the selected item into view #13

Closed fredrik-w closed 11 years ago

fredrik-w commented 11 years ago

Instead of getting a really long list of results that possibly extend over the screen it should be possibly to clip the result box. If you set a "max-height" and the "overflow" attribute to "auto" you will get just that. Awesomecomplete will however not understand that, which becomes clear when you navigate with the keyboard to an item outside the view.

By leveraging "scrollIntoView" only a few lines of code will take care of that for us. Most browsers have that function, though I don't know about cellphones and pads, so I added a check for it.

issa-tseng commented 11 years ago

Seems fair to me! Thanks!