bootstrap-select
bootstrap-select copied to clipboard
live search allows only one letter.
Tested using v1.13.18 and v1.13.14 Chrome Version 85.0.4183.102
When typing a second letter into the live serch box, this following piece of code clears the textbox and searches only the new letter:
(Line 2658) liveSearchListener: function () { var that = this;
this.$button.on('click.bs.dropdown.data-api', function () {
if (!!that.$searchbox.val()) {
that.$searchbox.val('');
that.selectpicker.search.previousValue = undefined;
}
});
...
I guess the purpose of this is clearing the textbox "on show" (?) (I don't have the time to fully debug the source. )
Hello! I have this problem too, Chrome: 86.0.4240.75 and IE11 Tested using v.1.13.16 and 1.13.18
Also, I've used webpack of different versions, but I'm not sure if the problem is with it.
Looks like it's related to the keydown event being triggered twice in a row. The first for when it adds the letter, then the dropdown dissappears like it's being redrawn which the event is triggered again so it doesn't have the .show class causing the code in the post above to be triggered.
figured out the issue, check that your not loading the bootstrap-select.js file twice. The library sets global events on $(document) so if you load the library twice, it attaches the eventing twice cause events to be triggered twice.
Did you solved it ? .. I have the same problem.