Skip to content

Commit c0fbf73

Browse files
Merge pull request #17347 from IgniteUI/bpachilova/combo-focusedItem-type-fix
fix(drop-down): focusedItem null type check - 21.2.x
2 parents c470743 + 3f55ba0 commit c0fbf73

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

projects/igniteui-angular/drop-down/src/drop-down/drop-down.base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export abstract class IgxDropDownBaseDirective implements IDropDownList, OnInit
2424
protected elementRef = inject(ElementRef);
2525
protected cdr = inject(ChangeDetectorRef);
2626
public document = inject(DOCUMENT);
27-
27+
2828
/**
2929
* Emitted when item selection is changing, before the selection completes
3030
*
@@ -227,14 +227,14 @@ export abstract class IgxDropDownBaseDirective implements IDropDownList, OnInit
227227
/**
228228
* @hidden @internal
229229
*/
230-
public get focusedItem(): IgxDropDownItemBaseDirective {
230+
public get focusedItem(): IgxDropDownItemBaseDirective | null {
231231
return this._focusedItem;
232232
}
233233

234234
/**
235235
* @hidden @internal
236236
*/
237-
public set focusedItem(item: IgxDropDownItemBaseDirective) {
237+
public set focusedItem(item: IgxDropDownItemBaseDirective | null) {
238238
this._focusedItem = item;
239239
}
240240

projects/igniteui-angular/drop-down/src/drop-down/drop-down.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface IDropDownList {
5656
collapsed: boolean;
5757
items: IgxDropDownItemBaseDirective[];
5858
headers: IgxDropDownItemBaseDirective[];
59-
focusedItem: IgxDropDownItemBaseDirective;
59+
focusedItem: IgxDropDownItemBaseDirective | null;
6060
navigateFirst(): void;
6161
navigateLast(): void;
6262
navigateNext(): void;

projects/igniteui-angular/drop-down/src/drop-down/drop-down.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class IgxDropDownComponent extends IgxDropDownBaseDirective implements ID
155155
/**
156156
* @hidden @internal
157157
*/
158-
public override get focusedItem(): IgxDropDownItemBaseDirective {
158+
public override get focusedItem(): IgxDropDownItemBaseDirective | null {
159159
if (this.virtDir) {
160160
return this._focusedItem && this._focusedItem.index !== -1 ?
161161
(this.children.find(e => e.index === this._focusedItem.index) || null) :
@@ -164,7 +164,7 @@ export class IgxDropDownComponent extends IgxDropDownBaseDirective implements ID
164164
return this._focusedItem;
165165
}
166166

167-
public override set focusedItem(value: IgxDropDownItemBaseDirective) {
167+
public override set focusedItem(value: IgxDropDownItemBaseDirective | null) {
168168
if (!value) {
169169
this.selection.clear(`${this.id}-active`);
170170
this._focusedItem = null;

0 commit comments

Comments
 (0)