oferh / ng2-completer

Angular 2 autocomplete component
http://oferh.github.io/ng2-completer/
MIT License
347 stars 172 forks source link

using arrow keys in dropdown doesn't scroll it #357

Closed m41n closed 6 years ago

m41n commented 6 years ago

I'm using the ng2-completer (version 1.6.3) for a longer list of strings. I also do give the dropdown a size limit with css:

/deep/ .completer-dropdown {
   width: 400px;
   height: 13rem;
}

Now, I do get a scroll-bar I can use just fine. But when I use the arrow keys to move through the options in the dropdown, it cycles through fine, but once it reaches the bottom of the currently displayed options, pressing the down-arrow key cycles further and outside of the display options without scrolling down. Using the up-arrow key however does scroll up just fine.

I also tried limiting the height with a pixel value instead, though the issue remains. Is there a way I can limit the dropdown height without causing the mentioned issue?

m41n commented 6 years ago

Well... a while of searching and I found a similiar issue in the closed section. Turns out, using height doesn't work, using max-height however does!

so for everyone else stumbling accross this: use max-height

I am closing this issue after that discovery.