Search Results are invisible


#1

Hello :slight_smile:,

i have build a “livesearch”. When i type a letter, the search results will be updated instantly.
missingResults
But in this example they are way more results than the shown 4 listed, but they are not visible. I can click on the invisible items an they behave like the others 4.

My HTML Code:

  <ion-searchbar [(ngModel)]="searchQuery" (input)="typing(searchQuery)" placeholder="search"> </ion-searchbar>

  <ion-card>
    <ion-list>
      <ion-item *ngFor="let name of namesShown" [(ngModel)]="selected" (click)="ListItemClick(name)">
        {{ name }}
      </ion-item>
    </ion-list>
  </ion-card>

My ts File:


  public names: String[] = [];
  public namesShown: String[] = [];

  public typing($value) {
    this.namesShown = this.names.filter((s: String) => s.match(new RegExp($value, "i")));
  }

Thank you in advance


#2

for what is that?
any error in the console?


#3

[(ngModel)]=“selected”

This was the remnant of trying to pass data to a fuction.
I’ve earased it and and my problem is solved.

Thanks a lot! :slight_smile: