diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index 63e7a524c..1eb060eb2 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -407,8 +407,9 @@ 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'), + isFirstCharsEqual = re.test(this.store.at(index).get(this.displayField)), itemCandidate, idxCandidate; for (var i=0; iindex) { itemCandidate = item; diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 03e16cc01..c58a1b5f1 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -472,8 +472,9 @@ 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'), + isFirstCharsEqual = re.test(this.items[index].caption), itemCandidate, idxCandidate; for (var i=0; iindex) { itemCandidate = item; @@ -1051,8 +1054,9 @@ 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'), + isFirstCharsEqual = re.test(this.items[index].caption), itemCandidate, idxCandidate; for (var i=0; iindex) { itemCandidate = item;