question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ionic 4 / Angular: ion-item-option needs to be clicked twice

See original GitHub issue

Ionic 4 Angluar

I’m submitting a …

[x ] bug report [ ] feature request

Current behavior: I have an ion-list with sliding items in it and crate these with a for loop. You can click on the item itself and the router navigates to another page. When you slide an item, a button is revealed. and this Button needs to be clicked twice (at 90% of the time) to fire.

Expected behavior: Click once to fire event (in my case: Open a Popup)

Related code:

<ion-list *ngFor="let item of items; let i = index" routerDirection="forward">
      <ion-item-sliding #slidingItem (click)="dosomething()">
        <ion-item >
        <ion-avatar>
          <img [src]=items[0].imgUrl>
        </ion-avatar>
        <h2>{{item[0].name}}</h2>
      </ion-item>
      <ion-item-options side="end">
          <ion-item-option (click)="dosomethingelse(i, $event, slidingItem)">
            <ion-button class="slideButton" >
              <ion-icon name="trash"></ion-icon>
            </ion-button>
          </ion-item-option>
        </ion-item-options>
      </ion-item-sliding>
    </ion-list>

also tried: (click) in the <ion-item> and the <ion-avatar> tags. Same behaviour 😦

My ionic info:

Ionic CLI                     : 5.2.4
Ionic Framework               : @ionic/angular 4.7.4
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics    : 8.1.3
@angular/cli                  : 8.1.3
@ionic/angular-toolkit        : 2.0.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
alexmelville7commented, Oct 16, 2019

I am also experiencing this issue. Unlike @Sunny41 mine is still requiring double clicks even without a button in the ion-item.

<ion-item-sliding *ngFor="let witness of claim.witness; let i=index">
    <ion-item detail='true' (click)='witnessDetail(i)'>
        <ion-icon name="person" slot='start'></ion-icon>
        <ion-label class="ion-text-wrap">
            <ion-text>Witness {{i + 1}}</ion-text>
            <p>{{witness.witnessFirstName + ' ' + witness.witnessLastName}}</p>
        </ion-label>
    </ion-item>
    <ion-item-options side="end">
        <ion-item-option color="danger" (click)="delete(i)">Delete</ion-item-option>
    </ion-item-options>
</ion-item-sliding>
Ionic CLI                     : 5.2.3
Ionic Framework               : @ionic/angular 4.11.1
@angular-devkit/build-angular : 0.803.0
@angular-devkit/schematics    : 8.3.0
@angular/cli                  : 8.3.0
@ionic/angular-toolkit        : 2.0.0
0reactions
kensodemanncommented, Jun 7, 2021

A minor update after further testing:

  • I have only been able to replicate while running on an iOS device
  • I have only been able to replicate when I accidentally perform a minor scrolling operation while opening the -ion-item-sliding, so having a slight up or down motion while also dragging left.

I suppose I could load up my screen with a bunch of fake data so it would actually scroll and see if it would actually occur then on Android, but I have not done that.

It is likely easier to repro on iOS because of the bounce effect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic 4 / Angular: ion-item-option needs to be clicked twice ...
When you slide an item, a button is revealed. and this Button needs to be clicked twice (at 90% of the time) to...
Read more >
Ion-item-option button needs to be clicked twice - Stack Overflow
I have found an improvement. but this doesn't do its job reliable. The first 3-4 times it works with just one click. after...
Read more >
IONIC 4 click event bug, I have to double click? - Ionic Forum
Issue: ion-input needs 2 click/tap to trigger event​​ User must tap twice to event "trigger". Code sample: <ion-input type="text" (tap)="handle_ ...
Read more >
Ion-item-option button needs to be clicked twice-angular.js
I have found an improvement. but this doesn't do its job reliable. The first 3-4 times it works with just one click. after...
Read more >
Ionic 4: Quickly add UX Through the Use of Double-taps!
Most users are trained to do things by instinct when interacting with apps. Ionic, despite being a great framework, doesn't always have all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found