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: modal, popover dismiss when ion-select is dismissed

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

I have a modal page with some inputs and drop-downs (ion-selects). When I click to the OK button after selecting an option, the click triggers the modal dismiss.

I could catch the event on the event listener:

const modal = await this._modalCtrl.create({
  component: RecordEditPage,
 ...
});
 
modal.onDidDismiss().then(() => {
  console.error('dismissed'); // I see it on the console
});

await modal.present();

When I set the canDismiss property to false, the modal works as expected, but I can’t close it through this._modalCtrl.dismiss();

Expected Behavior

Don’t close the modal on ion-select changes.

Steps to Reproduce

Create a component with some ion-select input. Open the modal with the modalController.

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.19.0 Ionic Framework : @ionic/angular 6.1.0 @angular-devkit/build-angular : 13.3.2 @angular-devkit/schematics : 13.3.2 @angular/cli : 13.3.2 @ionic/angular-toolkit : 6.1.0

Capacitor:

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

Utility:

cordova-res : 0.15.4 native-run : 1.5.0

System:

NodeJS : v14.17.0
npm : 8.6.0 OS : macOS Monterey

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
liamdebeasicommented, Apr 15, 2022

A fix for this has been released in Ionic v6.1.1.

1reaction
vicbcommented, Apr 14, 2022

Here is a repro on JS ionic https://codepen.io/vicb-the-lessful/pen/yLpRjwx

Can’t wait for the fix and thanks for reacting quickly !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic app freezes or stops working after popover and modal ...
I solved it by using "this.navCtrl.pop()" to close the modal insted of using "dismiss()" function. Note: Do not use "this.setRoot()" ...
Read more >
ion-modal: Ionic Mobile App Custom Modal ... - Ionic Framework
ion-modal is a dialog that appears on top of mobile app content, and must be dismissed before interaction resumes. Learn more about custom...
Read more >
Popover | Components - BootstrapVue
Dismiss on next click (self-dismissing). Use the focus trigger by itself to dismiss popovers on the next click that the user makes. focus...
Read more >
Ionic Snippets - Open VSX Registry
i-form-error, <ion-form> w/ <ion-input> and formGroup including error text ... i-modal-dismiss, Ionic modal dialog with dismiss.
Read more >
5 Examples of the new Ionic 6 Bottom Sheet Modal
The Ionic 6 modal comes with a brand new presentation mode called bottom ... Of course we also unsubscribe() when the modal is...
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