fastselect icon indicating copy to clipboard operation
fastselect copied to clipboard

addChoiceItem() doesn't update query input display - with solution

Open DiMono opened this issue 7 years ago • 0 comments

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.

DiMono avatar Oct 02 '18 05:10 DiMono