Updating search in menu component

This commit is contained in:
Alexei Koshelev 2022-10-18 16:41:55 +03:00
parent b9c5b2b014
commit 4d87c6d817

View file

@ -1051,7 +1051,7 @@ define([
},
selectCandidate: function() {
var index = this._search.index || 0,
var index = (this._search.index && this._search.index != -1) ? this._search.index : 0,
re = new RegExp('^' + ((this._search.full) ? this._search.text : this._search.char), 'i'),
itemCandidate, idxCandidate;
@ -1061,6 +1061,8 @@ define([
if (!itemCandidate) {
itemCandidate = item;
idxCandidate = i;
if(!re.test(this.items[index].caption))
break;
}
if (this._search.full && i==index || i>index) {
itemCandidate = item;