Skip to content

Commit 15d9179

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 566b801 commit 15d9179

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/kendo.list.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,8 @@ var __meta__ = { // jshint ignore:line
747747
value = optionValue;
748748
}
749749

750-
if (value !== unifyType(that._old, typeof value)) {
750+
if (value !== unifyType(that._old, typeof value) &&
751+
value !== unifyType(that._oldText, typeof value)) { // _oldText should be compared for ComboBox when arbitrary text is added https://github.com/telerik/kendo-ui-core/issues/4496
751752
trigger = true;
752753
} else if (that._valueBeforeCascade !== undefined && that._valueBeforeCascade !== unifyType(that._old, typeof that._valueBeforeCascade) && that._userTriggered) {
753754
trigger = true;
@@ -766,6 +767,8 @@ var __meta__ = { // jshint ignore:line
766767
}
767768
}
768769
that._oldIndex = index;
770+
// _oldText should be compared for ComboBox when arbitrary text is added https://github.com/telerik/kendo-ui-core/issues/4496
771+
that._oldText = that.text && that.text();
769772

770773
if (!that._typing) {
771774
// trigger the DOM change event so any subscriber gets notified

tests/combobox/events.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,27 @@ it("change should not be raised on tab after already changed value", function()
173173
combobox.input.focusout();
174174
});
175175

176+
it("change should not be raised twice on tab after edits of arbitrary text", function() {
177+
var counter = 0;
178+
179+
combobox = new ComboBox(input, {
180+
dataSource: [],
181+
change: function() {
182+
counter++;
183+
}
184+
});
185+
186+
for (var i = 0; i < 2; i++) {
187+
combobox.input.focus();
188+
combobox.input.val(i);
189+
combobox.input.press(kendo.keys.ENTER);
190+
combobox.input.press(kendo.keys.TAB);
191+
combobox.input.focusout();
192+
}
193+
194+
assert.equal(counter, 2);
195+
});
196+
176197
it("_change raises change event if selectedIndex has changed", function() {
177198
var select = $("<select/>");
178199

0 commit comments

Comments
 (0)