Skip to content

Commit

Permalink
Merge pull request #3082 from Akshat55/applicationref-tick
Browse files Browse the repository at this point in the history
fix: remove application ref tick to improve performane
  • Loading branch information
zvonimirfras authored Dec 5, 2024
2 parents 6ca6472 + cf30cf1 commit 8fad690
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/dropdown/dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {

import { AbstractDropdownView } from "./abstract-dropdown-view.class";
import { I18n } from "carbon-components-angular/i18n";
import { ListItem } from "./list-item.interface";
import { DropdownService } from "./dropdown.service";
import { ElementService, getScrollableParents } from "carbon-components-angular/utils";
import { hasScrollableParents } from "carbon-components-angular/utils";
Expand Down
13 changes: 8 additions & 5 deletions src/dropdown/list/dropdown-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import {
ViewChild,
ElementRef,
ViewChildren,
QueryList,
ApplicationRef
QueryList
} from "@angular/core";
import { Observable, isObservable, Subscription, of } from "rxjs";
import {
Observable,
isObservable,
Subscription,
of
} from "rxjs";
import { first } from "rxjs/operators";

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

/**
* Retrieves array of list items and index of the selected item after view has rendered.
Expand Down Expand Up @@ -564,7 +568,6 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
this.index = this.displayItems.indexOf(item);
this.highlightedItem = this.getItemId(this.index);
this.doEmitSelect(false);
this.appRef.tick();
}
}

Expand Down

0 comments on commit 8fad690

Please sign in to comment.