Skip to content

Commit 89ca7a0

Browse files
committed
Do not override the model value if the text value is representing the same model value
1 parent cdb0cbf commit 89ca7a0

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
@@ -56,7 +56,13 @@ export class IgComboComponent extends IgControlBase<IgCombo> implements ControlV
5656
if (this._model) {
5757
if (this.options.allowCustomValue) {
5858
jQuery(this._el).on('input', evt => {
59-
this._model.viewToModelUpdate(evt.target.value);
59+
// D.K. #324 Do not override the model value if the text value is representing the same model value
60+
let item = jQuery(this._el).data("igCombo").itemsFromValue(this._model.model);
61+
if (this.options.multiSelection && this.options.multiSelection.enabled ||
62+
!item ||
63+
item.data && item.data.text !== evt.target.value) {
64+
this._model.viewToModelUpdate(evt.target.value);
65+
}
6066
});
6167

6268
jQuery(this._el).closest('.ui-igcombo-wrapper').find('.ui-igcombo-clear').on('click', () => {

0 commit comments

Comments
 (0)