xcash / bootstrap-autocomplete

Bootstrap Autocomplete
MIT License
168 stars 72 forks source link

Limit number of entries in the dropdown list #133

Open recursivetree opened 2 years ago

recursivetree commented 2 years ago

When the dropdown list has many suggestions, they might get longer than the rest of the page. In my case, that results in the page overflowing at the bottom.

My question is if it is possible to add an option to limit the number of suggestions that are rendered.

Maybe there is a way to check if we are overflowing instead as a second option?

Bildschirmfoto 2021-12-12 um 21 14 00

SantaFox commented 2 years ago

I think it is easier to limit results on server side, keeping the JavaScript smaller. The only reason to do it on client side is to write something line "There are 300 more results" in the last line

recursivetree commented 2 years ago

it is easier sure, but you never know how big the browser will be. Depending on if it is a smartphone or desktop, the possible maximum length can be different. That goes more into the direction of the second option