Skip to content

Commit a42a4ac

Browse files
refactor(simple-combo): check for undefined & if newSelection is array
1 parent 936d255 commit a42a4ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

projects/igniteui-angular/src/lib/simple-combo/simple-combo.component.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
199199

200200
/** @hidden @internal */
201201
public handleInputChange(event?: any) {
202-
this.searchValue = event.target.value;
202+
if (event !== undefined) {
203+
this.searchValue = typeof event === 'string' ? event : event.target.value;
204+
}
203205
this._onChangeCallback(this.searchValue);
204206
if (this.collapsed && this.comboInput.focused) {
205207
this.open();
@@ -362,10 +364,11 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
362364
};
363365
this.selectionChanging.emit(args);
364366
if (!args.cancel) {
365-
const argsSelection = args.newSelection !== undefined
367+
let argsSelection = args.newSelection !== undefined
366368
&& args.newSelection !== null
367-
? [args.newSelection]
369+
? args.newSelection
368370
: [];
371+
argsSelection = Array.isArray(argsSelection) ? argsSelection : [argsSelection];
369372
this.selectionService.select_items(this.id, argsSelection, true);
370373
if (this._updateInput) {
371374
this.comboInput.value = this._value = displayText !== args.displayText

0 commit comments

Comments
 (0)