ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Modal using isOpen works with undefined value, but should throw an error

Open hesch opened this issue 2 months ago • 0 comments

Prerequisites

Ionic Framework Version

v7.x, v8.x

Current Behavior

The bug that occurred in my case was that the modal stopped opening, when using isOpen and navigating to the page a second time. This bug is really hard to diagnose, because it somehow only happens on the second load of the components containing the modal.

Expected Behavior

The modal should either break, if isOpen is undefined or work even if the value is undefined. The first one might be harder to implement, because it seems like angular is not properly propagating the value to the modal component.

Steps to Reproduce

  1. Click the 'Open' button => this opens the modal fine
  2. Close the modal
  3. Click to 'Toggle component' button twice to unload and load the example component
  4. Click the 'Open' button => the modal does not open

Code Reproduction URL

https://stackblitz.com/edit/angular-rwk8ir?file=src%2Fapp%2Fexample.component.ts

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (/Users/**********/.nvm/versions/node/v21.6.1/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 7.8.2 @angular-devkit/build-angular : 17.3.3 @angular-devkit/schematics : 17.3.3 @angular/cli : 17.3.3 @ionic/angular-toolkit : 9.0.0

Capacitor:

Capacitor CLI : 5.7.4 @capacitor/android : 5.7.4 @capacitor/core : 5.7.4 @capacitor/ios : 5.7.4

Utility:

cordova-res : not installed globally native-run : 2.0.1

System:

NodeJS : v21.6.1 (/Users/**********/.nvm/versions/node/v21.6.1/bin/node) npm : 10.2.4 OS : macOS Unknown

Additional Information

No response

hesch avatar May 31 '24 06:05 hesch