Error search - ion-searchbar

#1

Good evening everyone
I’m having a problem with a search code and would like help.
As you type in the search field, the list changes and works normally, but when you delete what you typed the list does not return with all the elements.
Can someone help me?
Thank you

<ion-searchbar (ionInput)=“getTopics($event)” [showCancelButton]=“shouldShowCancel” (ionCancel)=“onCancel($event)”>

<ion-list>
    <ion-item *ngFor="let topic of cuponsTotais">
      {{ topic.numerocupom }}
    </ion-item>
  </ion-list>

Array: (12) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
0:{numerocupom: “0620”}
1:{numerocupom: “1109”}
2:{numerocupom: “1441”}
3:{numerocupom: “2810”}
4:{numerocupom: “2827”}
5:{numerocupom: “3141”}
6:{numerocupom: “3260”}
7:{numerocupom: “3715”}
8:{numerocupom: “5104”}
9:{numerocupom: “5613”}
10:{numerocupom: “5632”}
11:{numerocupom: “6037”}
length:12
proto:Array(0)

getTopics(ev: any) {
let serVal = ev.target.value;
if (serVal && serVal.trim() != ‘’) {
this.cuponsTotais = this.cuponsTotais.filter((topic) => {
return (topic.numerocupom.indexOf(serVal.toLowerCase()) > -1);
})
}
}