ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.96k stars 13.52k forks source link

bug: ion-alert click handler not removed during forceUpdate #19948

Closed ciekawy closed 4 years ago

ciekawy commented 4 years ago

Bug Report

Ionic version:

[x] 4.x

Current behavior:

when used with Bugsnag integration, ion-select (tested with multiple choice) using default ion-alert accepts only first change, no reaction for subsequent clicks on option checkboxes.

Expected behavior:

Able to make multiple changes.

Steps to reproduce:

was trying to reproduce the issue but without success. I believe this may be related to change detection or sth, as new click handlers are added during ion-alert component update

What I found is that this is combination of BugSnag which I use and ion-select implementation:

I believe there is some conflict in the handlers registering/deregistering code yet not sure how to proceed - possibly some fix is required in either Ionic or Bugsnag.

I was not able to reproduce the issue using this Ionic Angular StackBlitz (using test Bugsnag account): https://stackblitz.com/edit/ionic-v4-m21b3k - I believe this may be related to the change detection strategy or some similar setting...

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.2
   Ionic Framework               : @ionic/angular 4.11.1
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : android 7.1.4, browser 5.0.4, ios 4.5.4
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 16 other plugins)

Utility:

   cordova-res : 0.6.0 (update available: 0.8.1)
   native-run  : 0.2.8 (update available: 0.2.9)

System:

   Android SDK Tools : 26.1.1 (/usr/local/share/android-sdk)
   ios-deploy        : 1.9.4
   ios-sim           : 8.0.1
   NodeJS            : v11.15.0 (/Users/szymon/.nvm/versions/node/v11.15.0/bin/node)
   npm               : 6.9.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001

  ───────────────────────────────────────────────

     Ionic CLI update available: 5.4.2 → 5.4.5
           Run npm i -g ionic to update

  ───────────────────────────────────────────────
ciekawy commented 4 years ago

also my related SO question https://stackoverflow.com/questions/58937524/event-listeners-not-removed-as-ionic-4-angular-conflicts-with-bugsnag-addevent

ciekawy commented 4 years ago

Just found that updating @bugsnag/js to version 6.4.3 solved the issue.

ionitron-bot[bot] commented 4 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.