Ui-select-choices doesn't render option from refresh when deleting and re-inputting the same input with minimum-input-length.
I have an ui-select with minimum n characters.
1: Input xx...xx, it works normally.
2: Delete whole xx...xx or few characters (input length lower than minimum length) then re-input it (new input is exactly the same as old one), trigger refresh function and return result but ui-select-choices does not render anything.
Ui-select
<ui-select ng-model="ctrl.number.selected"
theme="bootstrap"
ng-disabled="ctrl.disabled"
reset-search-input="false"
style="width: 600px;"
title="Choose an number">
<ui-select-match placeholder="Enter an number...">{{$select.selected.id}}</ui-select-match>
<ui-select-choices repeat="number in ctrl.numbers track by $index"
minimum-input-length="3"
refresh="ctrl.refreshNumber($select.search)"
refresh-delay="0">
<div ng-bind-html="number"></div>
</ui-select-choices>
</ui-select>
Refresh function
vm.refreshNumber = function(index) {
if (index !== null && index !== undefined && index !== '') {
vm.numbers = [];
vm.testData.forEach(function(item){
if(item.id === parseInt(index)) {
vm.numbers = item.data;
}
});
}
}
Is it a Ui-Select bug? If not then what should I do?