machineboy2045 / angular-selectize

angular-selectize
MIT License
201 stars 115 forks source link

Angular selectize directive - I can't type in input when I select empty option #170

Open valikonen opened 7 years ago

valikonen commented 7 years ago

I use angular selectize with these options:

$rootScope.mySelectize = {
    allowEmptyOption: true,
    valueField: 'id',
    labelField: 'label',
    searchField: ['label'],
    maxItems: 1
};

and in view:

<selectize 
    config='mySelectize' 
    name="country" 
    options='referenceData.country' 
    ng-model="vm.searchForm.countryId">
</selectize>

Problem: when I select an option, lets say Germany and after I change it to empty option, I can't type into the input, I must delete this empty option from my keyboard to be able to type again.

Any idea how I can reset/clear this option if the user switch between an option with value and one empty?

Thanks.