fastselect
fastselect copied to clipboard
addChoiceItem() doesn't update query input display - with solution
As coded, if you programmatically call addChoiceItem() on a fastselect with no selected values, the input still thinks it's attached to a fastselect with no selected values, even though you just selected one. The expected behaviour is that when you programmatically select one, the input will adjust its display to reflect the fact that you have at least one value selected. I was able to accomplish this by adding the following code to addChoiceItem, defined on line 703 in the current build:
711 this.$el.removeClass(this.options.noneSelectedClass);
712 this.$queryInput.removeClass(this.options.queryInputExpandedClass).attr('placeholder','').val('');
With this edit, the input adjusts automatically when an item is programmatically selected.