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.

bug: action sheet button handler triggered twice

See original GitHub issue

Bug Report

Since ionic 5.2.0 the action sheet button handler is triggered twice (I just tested action sheet, maybe the same problem happens with other overlay buttons as well, e.g. ion-alert)

Ionic version:

[x] 5.2.0

Current behavior: Action sheet button handler triggered twice

Expected behavior: Action sheet button handler triggered only once

Related code:

public async presentHandleAttachmentActionSheet(): Promise<void> {
    const actionSheetOptions: ActionSheetOptions = {
      buttons: [
        {
          text: this.translationService.translate('action.delete'),
          role: 'destructive',
          handler: () => {
            console.log('delete clicked');
          }
        },
        {
          text: this.translationService.translate('action.show'),
          handler: () => {
            console.log('open clicked');
          }
        },
        {
          text: 'cancel'
          role: 'cancel'
        }
      ]
    };

    const actionSheet = await this.actionSheetController.create(actionSheetOptions);
    await actionSheet.present();
  }

Console log is triggered twice in this example on click on one of the buttons

Ionic info:

Ionic:

   Ionic CLI                     : 6.10.0 (/Users/pascalgraf/.nvm/versions/node/v12.11.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.2.0
   @angular-devkit/build-angular : 0.803.25
   @angular-devkit/schematics    : 8.3.25
   @angular/cli                  : 8.3.25
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.4.1, (and 26 other plugins)

Utility:

   cordova-res (update available: 0.14.0) : 0.9.0
   native-run (update available: 1.0.0)   : 0.2.9

System:

   Android SDK Tools : 26.1.1 (/Users/pascalgraf/Library/Android/sdk)
   ios-deploy        : 1.9.4
   ios-sim           : 8.0.2
   NodeJS            : v12.11.1 (/Users/pascalgraf/.nvm/versions/node/v12.11.1/bin/node)
   npm               : 6.13.7
   OS                : macOS Catalina
   Xcode             : Xcode 11.5 Build version 11E608c

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Jun 12, 2020

Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic/pull/21506, and a fix will be available in the next release of Ionic Framework.

1reaction
rdlabocommented, Jun 12, 2020

I confirmed fix of double click at action-sheet👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: action sheet button handler triggered twice · Issue #21503
Bug Report Since ionic 5.2.0 the action sheet button handler is triggered twice (I just tested action sheet, maybe the same problem happens ......
Read more >
jQuery Button.click() event is triggered twice - Stack Overflow
In that case, we can do the following $('selected').unbind('click').bind('click', function (e) { do_something(); });. I had the event firing two times ...
Read more >
button trigger behaviour: "release only" triggers twice!?
I create a very simple input with a trigger behaviour of "Release only" but it triggers once when the key is pressed and...
Read more >
Notification trigrring twice for UI action. - ServiceNow Community
Solved: Hi, Requirment: send out a notification when user clicks Escalate button available on the incident form Solution: I have made a UI ......
Read more >
action from commandButton on submit executes twice on 2 ...
Hi, The problem seems to be with the onclick.If I have 2 command buttons on the same page and I try to click...
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