Referring #1076 , I have no idea how to do a pull request, but the following code replaces lines 1252-1253 in bootstrap-select.js (the end lines of the function this.$searchbox.on('input propertychange', function () )
It should effectively select the first matched item (if found), case insensitive, when performing a live search, while still allowing all the other selection functionality.
var foundItem;
if (that.options.liveSearchNormalize) {
foundItem = that.$lis.filter(':aibegins(' + normalizeToBase(that.$searchbox.val()) + ')')[0];
} else {
foundItem = that.$lis.filter(':ibegins(' + that.$searchbox.val() + ')')[0];
}
if (typeof foundItem != "undefined") {
//find the index of the match
var foundItemIndex = that.$lis.index(foundItem);
//Select the match!
$(this).parent().data('prevIndex', foundItemIndex);
that.$lis.removeClass('active').eq(foundItemIndex).addClass('active').children('a').focus();
} else {
//Adjust the active selector if nothing (visible) is active
if (that.$lis.not('.hidden, .divider, .dropdown-header').filter('.active').length == 0) {
that.$lis.filter('.active').removeClass('active');
//Activate the top-most visible option
that.$lis.not('.hidden, .divider, .dropdown-header').eq(0).addClass('active').children('a').focus();
}
}
Referring #1076 , I have no idea how to do a pull request, but the following code replaces lines 1252-1253 in bootstrap-select.js (the end lines of the function this.$searchbox.on('input propertychange', function () ) It should effectively select the first matched item (if found), case insensitive, when performing a live search, while still allowing all the other selection functionality.