Nitin Karale
Nitin Karale

Reputation: 797

Why is ion-item click not working in ionic4 for ios?

ion-item clickable event not working in ios but its working fine in android. I have searched lot of in google but find any suitable answer.

  <ion-content >
   <div>       
    <ion-searchbar (ionInput)="getItems($event)"></ion-searchbar>
    <ion-list  lines="full" >
      <ion-item class="bg-class" *ngFor="let project of filterData" (click)="onProjectClick(project.npProjCode);">
       <ion-icon name="arrow-dropright-circle" style="width: 14px;margin-right: 10px;color: #129bcc;"></ion-icon>
       <ion-label>{{project.npProjDescn}}</ion-label> 
       <ion-icon name="ios-arrow-forward" slot="end" style="color: lightgray;"></ion-icon>
      </ion-item>
    </ion-list>
   </div>
 </ion-content>

Upvotes: 2

Views: 2150

Answers (3)

Nitin Karale
Nitin Karale

Reputation: 797

Got solution, Its work in ios & android

<ion-item button class="bg-class" *ngFor="let project of filterData" (click)="onProjectClick(project.npProjCode);">

-

ion-item[button] {
      pointer-events: initial !important;
  }

Upvotes: 5

Daniel V&#225;gner
Daniel V&#225;gner

Reputation: 846

I have the similar problem, but after login. It was called at background. On Android it worked normally, however, on iOS it did not work at all.

Try to debug if Its not the same problem in .ts

Upvotes: 0

Muhammed Albarmavi
Muhammed Albarmavi

Reputation: 24424

last time I have this problem I fix it like this , hop it work for you

@ViewChild('searchbar', { static: true }) searchbar: IonSearchbar;

ngOnInit() {

this.sub = this.searchbar.ionInput
      .subscribe(q => this.getItems(q))
}

template

<ion-searchbar #searchbar ></ion-searchbar>

Upvotes: 0

Related Questions