Skip to content

Commit b092ac5

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent ea486b4 commit b092ac5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/kendo.list.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,7 @@ var __meta__ = { // jshint ignore:line
19941994
var selectable = that.options.selectable;
19951995
var singleSelection = selectable !== "multiple" && selectable !== false;
19961996
var selectedIndices = that._selectedIndices;
1997+
var uiSelectedIndices = [this.element.find(".k-state-selected").index()];
19971998

19981999
var added = [];
19992000
var removed = [];
@@ -2016,7 +2017,9 @@ var __meta__ = { // jshint ignore:line
20162017
return deferred;
20172018
}
20182019

2019-
if (singleSelection && !filtered && $.inArray(last(indices), selectedIndices) !== -1 && that._emptySearch) {
2020+
if (singleSelection && !filtered &&
2021+
$.inArray(last(indices), selectedIndices) !== -1 && $.inArray(last(indices), uiSelectedIndices) !== -1) {
2022+
20202023
if (that._dataItems.length && that._view.length) {
20212024
that._dataItems = [that._view[selectedIndices[0]].item];
20222025
}

tests/combobox/suggestion.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ it("suggest int values on search", function() {
302302
assert.equal(combobox.input.val(), "1");
303303
});
304304

305-
it("reselects same index items after clearing input", function() {
305+
it("reselects same index items after clearing filter", function() {
306306
combobox = new ComboBox(input, {
307307
dataTextField: "text",
308308
dataValueField: "value",
@@ -311,12 +311,10 @@ it("reselects same index items after clearing input", function() {
311311
delay: 0
312312
});
313313

314-
combobox.input.focus();
315-
combobox.search("baz");
316-
combobox.select(0);
317314

318-
combobox.input.val("");
319-
combobox.open();
315+
combobox.search("Baz");
316+
combobox.select(0);
317+
combobox.search("");
320318
combobox.select(0);
321319

322320
assert.equal(combobox.text(), "Foo");

0 commit comments

Comments
 (0)