Skip to content

Commit cf30cf1

Browse files
committed
fix: remove application ref tick to improve performane
Signed-off-by: Akshat Patel <[email protected]>
1 parent 6ca6472 commit cf30cf1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/dropdown/dropdown.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525

2626
import { AbstractDropdownView } from "./abstract-dropdown-view.class";
2727
import { I18n } from "carbon-components-angular/i18n";
28-
import { ListItem } from "./list-item.interface";
2928
import { DropdownService } from "./dropdown.service";
3029
import { ElementService, getScrollableParents } from "carbon-components-angular/utils";
3130
import { hasScrollableParents } from "carbon-components-angular/utils";

src/dropdown/list/dropdown-list.component.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ import {
99
ViewChild,
1010
ElementRef,
1111
ViewChildren,
12-
QueryList,
13-
ApplicationRef
12+
QueryList
1413
} from "@angular/core";
15-
import { Observable, isObservable, Subscription, of } from "rxjs";
14+
import {
15+
Observable,
16+
isObservable,
17+
Subscription,
18+
of
19+
} from "rxjs";
1620
import { first } from "rxjs/operators";
1721

1822
import { I18n } from "carbon-components-angular/i18n";
@@ -224,7 +228,7 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
224228
/**
225229
* Creates an instance of `DropdownList`.
226230
*/
227-
constructor(public elementRef: ElementRef, protected i18n: I18n, protected appRef: ApplicationRef) {}
231+
constructor(public elementRef: ElementRef, protected i18n: I18n) {}
228232

229233
/**
230234
* Retrieves array of list items and index of the selected item after view has rendered.
@@ -564,7 +568,6 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
564568
this.index = this.displayItems.indexOf(item);
565569
this.highlightedItem = this.getItemId(this.index);
566570
this.doEmitSelect(false);
567-
this.appRef.tick();
568571
}
569572
}
570573

0 commit comments

Comments
 (0)