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

Accepting non-list item with accept-user-input=false #317

Open klawson4311 opened 6 years ago

klawson4311 commented 6 years ago

HTML

<input autocomplete="off" ngui-auto-complete formControlName="my_form_control" re-focus-after-select type="text" [source]="list_of_values" [accept-user-input]="false" list-formatter="name" max-num-list="5">

Current behavior

Steps to Repeat: 1) Focus 2) Enter to select 3) Backspace 4) Tab away Result: First item less 1 character.
This selects an item NOT in the list.

Expected/desired behavior

Don't allow user to select anything not in the list (accept-user-input = false)

almothafar commented 6 years ago

Have you tried to set [tab-to-select]="false" anyway I'm not sure what the problem, accept-user-input should be true if you want to get user input, isn't?

coderundebug12 commented 6 years ago

@almothafar read the apis first then comment

almothafar commented 6 years ago

@coderundebug12 the title confused me so I thought he wants to accept even with "accept-user-input=true", sorry if was misunderstand, but your comment could be better instead of aggressive one.

The problem was getting what the issue saying, my fault did not read the last part maybe, not that I don't know what API should do.