axel-zarate / js-custom-select

Custom auto-complete select box for AngularJS and Bootstrap
MIT License
68 stars 59 forks source link

How to remove selected item #43

Closed sharathm89 closed 6 years ago

sharathm89 commented 8 years ago

Once i search and select the item how can i clear it, if i feel i need to leave it blank

Amenel commented 8 years ago

Maybe just clear the model that the control is bound to? I mean, reset your ngModel. But if what you're after is removing the selected item from the list of items, then remove it from the collection of items and Angular should take care of the rest. Which do you want and how did it work?

sharathm89 commented 8 years ago

dropdown

if you see the above image i have selected Mr now if i feel that i am not sure about the prefix then i have to clear it basically leave empty. But in current control once selected there is no provision to de-select it or make it empty or reload the page and do it carefully. But we can't say user's to reload it.

axel-zarate commented 8 years ago

As of now there is no built-in functionality to clear selected items but you could add a button next to it that when clicked, sets the ng-model property to null or undefined.