Skip to content

Commit aaa6896

Browse files
refactor(combo-common): remove arg from deselect
1 parent d7936b0 commit aaa6896

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

projects/igniteui-angular/src/lib/combo/combo.common.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export interface IgxComboBase {
5555
isItemSelected(itemID: any): boolean;
5656
select(item: any): void;
5757
select(itemIDs: any[], clearSelection?: boolean, event?: Event): void;
58-
deselect(item: any): void;
59-
deselect(itemIDs: any[], event?: Event): void;
58+
deselect(...args: [] | [itemIDs: any[], event?: Event]): void;
6059
}
6160

6261
let NEXT_ID = 0;
@@ -1214,8 +1213,7 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
12141213
public abstract select(newItem: any): void;
12151214
public abstract select(newItems: Array<any> | any, clearCurrentSelection?: boolean, event?: Event): void;
12161215

1217-
public abstract deselect(item: any): void;
1218-
public abstract deselect(items: Array<any>, event?: Event): void;
1216+
public abstract deselect(...args: [] | [items: Array<any>, event?: Event]): void;
12191217

12201218
public abstract writeValue(value: any): void;
12211219

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
7979
/** @hidden @internal */
8080
public composing = false;
8181

82-
private _updateInput = false;
82+
private _updateInput = true;
8383

8484
/** @hidden @internal */
8585
public get filteredData(): any[] | null {
@@ -121,18 +121,15 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
121121
}
122122

123123
/**
124-
* Deselect a defined item
124+
* Deselect the currently selected item
125125
*
126126
* @param item the items to be deselected
127127
* ```typescript
128128
* this.combo.deselect("New York");
129129
* ```
130130
*/
131-
public deselect(item: any): void {
132-
if (item !== null && item !== undefined) {
133-
const newSelection = this.selectionService.delete_items(this.id, item instanceof Array ? item : [item]);
134-
this.setSelection(newSelection);
135-
}
131+
public deselect(): void {
132+
this.clearSelection();
136133
}
137134

138135
/** @hidden @internal */
@@ -225,7 +222,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
225222
}
226223
this.clearSelection(true);
227224
if (this.collapsed) {
228-
this.getEditElement().focus();
225+
this.open();
229226
} else {
230227
this.focusSearchInput(true);
231228
}

0 commit comments

Comments
 (0)