Description
If you start typing in a multiselect input, the displayed results are filtered based on your search criteria. This is good!
If you then click on one of the results, the search string disappears, but the results remain filtered, with no visual cue as to what's wrong or how to fix it. This is bad.
It's caused by line 454 of fastselect.js, which is as follows:
451 clear: function() {
452
453 this.hideResults();
454 this.$input.val('').trigger('change');
455
456 return this;
457
458 },
The problem is that there is no listener for the change event! This can be fixed by changing line 454 to
this.$input.val('').trigger('keyup');
This change will cause the input to correctly re-open the results with no filter applied. Of course, you might decide that it's better to let the user choose whether to clear the filter, in which case you'd want to remove that line entirely, but I'm sure that comes down to personal preference. The clear()
function is only called under this circumstance, so you will not break anything else by commenting out line 454 if that is your desired behaviour.