oferh / ng2-completer

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

select when when user click on 'enter' does not work #373

Open na-le opened 6 years ago

na-le commented 6 years ago

I need to implement this behavior: when user write full element from the collection and then click 'enter' - it should select the element. it doesn't work if I use autoMatch it select the first even if I didn't finish to write the whole word - it's not good for me. how can I cause the component select on 'enter' if it match an element from the collection (case insensitive)?

oferh commented 6 years ago

that's something you need to validate outside of the component by checking component value and making sure it's equal to one of the items on your list

na-le commented 6 years ago

how? I didn't see any validator

oferh commented 6 years ago

there's no validator you should do it onn selected