ng2-ui / auto-complete

Angular Auto Complete component and directive
https://ng2-ui.github.io/dist/#/auto-complete
MIT License
279 stars 123 forks source link

Automatically selecting first item is now optional #244

Closed lemarsu closed 7 years ago

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).

This PR adds an Input named auto-complete-first-item, that when set to true, will automatically select first element of list (as before). If the input is not specified or set to false, then the user will be force to select manually his desired value.

ghost commented 7 years ago

Excellent!. Can we change the name to auto-select-first-item? Seems more intuitive what do you think? :) Also, can we update the README.md with this new option?

@allenhwkim what do you think?

lemarsu commented 7 years ago

Funny, this is the first name I had in mind, but thought it was not explicit enough. I can totally change the input name. I can also update the README.md, but I rather wait for an answer from @allenhwkim, so I'll won't have to revert it just after. :)

lemarsu commented 7 years ago

I just pushed PR #245 to implement @evasquez26 suggestions.