ng2-ui / auto-complete

Angular Auto Complete component and directive
http://ng2-ui.github.io/auto-complete/
MIT License
280 stars 124 forks source link

How to prevent first value being not selected until user press down arrow? #207

Closed venkiit58 closed 1 month ago

venkiit58 commented 7 years ago

Hi Team,

Thanks for this great feature. I'm struggling to fix this on my own. I'd like to prevent selection of very first item in autosuggest dropdown. I want user to press down arrow if they want to change the value.

Current problem is, I've a search results page and autosuggest redirect to corresponding page too. However, when I submit the form without completing full word it redirects to the actual page of the very first word. I want a facility where user can press down arrow if wanted to redirect or redirect them to results page.

Hope this explains the problem.

Thanks, Venkat

shariqs commented 7 years ago

I would like an answer to this too. Thanks.

kattianita commented 7 years ago

Is there a work around for this issue? I do not want the first item in the drop down to be selected by default - unless the user scrolls and picks that item.. By default the first item in the list is selected and I see that the class for the first li is set to selected --

ghost commented 7 years ago

I'm currently struggling with this too.

ghost commented 7 years ago

This should be fixed on version 0.13.4, please see the referenced PR

lemarsu commented 7 years ago

I can understand that in some cases, the expected behaviour is to not select first item. But it isn't always the case. The PR #240 remove completely the possibility to automatically select first item. Unfortunately, I require this feature (even if it's a bug for the rest of the world).

The PR #244 makes this feature optional.

almothafar commented 1 month ago

This issue is stale. Please consider opening a new issue with details for the latest version if you are still facing the same issue or need improvement.

Closing it.