Skip to content

Commit

Permalink
don't filter emojis if virtualize is false
Browse files Browse the repository at this point in the history
  • Loading branch information
agiangrant committed Mar 26, 2021
1 parent b1b311d commit f14d4f3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/lib/picker/category.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export class CategoryComponent implements OnChanges, OnInit, AfterViewInit {

ngOnChanges(changes: SimpleChanges) {
if (changes.emojis?.currentValue?.length !== changes.emojis?.previousValue?.length) {
this.emojis = this.filterEmojis();
this.ngAfterViewInit();
}
}
Expand All @@ -177,6 +176,8 @@ export class CategoryComponent implements OnChanges, OnInit, AfterViewInit {
return;
}

this.emojis = this.filterEmojis();

const { width } = this.container.nativeElement.getBoundingClientRect();

const perRow = Math.floor(width / (this.emojiSize + 12));
Expand Down Expand Up @@ -276,11 +277,7 @@ export class CategoryComponent implements OnChanges, OnInit, AfterViewInit {
return item;
}

private filterEmojis(): any[] | null | undefined {
if (!this.emojis) {
return this.emojis;
}

private filterEmojis(): any[] {
const newEmojis = [];
for (const emoji of this.emojis || []) {
if (!emoji) {
Expand Down

0 comments on commit f14d4f3

Please sign in to comment.