Skip to content

Commit e2de89f

Browse files
committed
Do not override the model value if the text value is representing the same model value
1 parent d9df85e commit e2de89f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

projects/igniteui-angular-wrappers/src/lib/igcombo/igcombo.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ export class IgComboComponent extends IgControlBase<IgCombo> implements ControlV
4343
if (this._model) {
4444
if (this.options.allowCustomValue) {
4545
jQuery(this._el).on("input", function (evt) {
46-
that._model.viewToModelUpdate(evt.target.value);
46+
// D.K. #324 Do not override the model value if the text value is representing the same model value
47+
let item = jQuery(that._el).data("igCombo").itemsFromValue(that._model.model);
48+
if (that.options.multiSelection && that.options.multiSelection.enabled ||
49+
!item ||
50+
item.data && item.data.text !== evt.target.value) {
51+
that._model.viewToModelUpdate(evt.target.value);
52+
}
4753
});
4854

4955
jQuery(this._el).closest(".ui-igcombo-wrapper").find(".ui-igcombo-clear").on("click", function() {

0 commit comments

Comments
 (0)