Is their an option that drop down stay closed after removing a selected item using remove_button plugin?
I set openOnFocus: false but drop down open after removing item.
If you populate options from an AJAX response, try this workaround:
onItemRemove: function(item) {
// Remove the deleted item also from the set
// of available options
this.removeOption(item);
},
onItemAdd: function ( /* item */ ) {
for(var o in this.options) {
if(this.items.indexOf(o) === -1) {
this.removeOption(o);
}
}
this.loadedSearches = [];
this.close();
}
This removes all options (suggestions in the list) whenever you select or remove an item, but makes sure that the items that you remove is not selected.
Thanks, this works fine
Most helpful comment
If you populate options from an AJAX response, try this workaround:
This removes all options (suggestions in the list) whenever you select or remove an item, but makes sure that the items that you remove is not selected.