-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0.0-beta.5] Cannot close modal 'overlay does not exist' #15349
Comments
How do you use it in ts file? I have found the same problem in PopoverController when use 'this.popoverController.dismiss()',but use popover which create by PopoverController, popover.dismiss() works well. |
@woodstream Indeed, I have found the same in the case of modal overlays. This works (within the component launched as a modal):
but this doesn't:
whereas the latter used to work in the previous version. I am now using this method as a workaround. |
same issue too |
@abennouna I have read this; this is not the problem. My code used to work in Ionic 4.0.0-beta.4 and is documented here: https://beta.ionicframework.com/docs/api/modal-controller |
@woodstream helped us solve this by altering the code creating the modal to:
And then in the modal:
|
@HoverBaum, that really feels like a hack... :/ |
I guess it has to do with that: c1c5102 from the release note (https://github.com/ionic-team/ionic/releases) Adding an id to the parrams fixes it but the documentation does not mention what these parameters do (data, role, id ), i only know that you can pass data to the parent using data: this.modalController.dismiss(null, undefined, 1);
|
@bleuscyther if we pass
it would work. But still looks like bug. |
I think this is a bug that should be fix without workaround |
@goelectricstations true, what i think is happening is that the default value for id is not good. I could propose a pull request but i would like to understand what role and id do. |
Could confirm the same bug Stacktrace:
Code (in my modal):
|
@ptitjes yeah that solution is a hack around. Just wanted to share a temporary solution we found to help out others who might come here looking for one. Looking forward to a real fix for this 🙂 |
@manucorporat I just updated to "@ionic/angular": "^4.0.0-beta.11", and this problem just surfaced today. is this a regression? |
@nikmartin I've upgraded to beta-11 too, don't face any regressions regarding this what's your stacktrace and code |
@peterpeterparker : Two things happened when I updated this morning. First, any page in my app that uses a modal controller, that modal gets loaded when the page loads. As in, I see the modal briefly as the calling page loads. This causes several errors, because route params expected by the moidal are missing. When the main page loads the modal, it loads fine, route params are passed as written, but closing the modal gives this error:
const modal = await this.modalCtrl.create({
async dismiss(isConfirmed) {
|
@nikmartin the only difference I see is that I don't specify the 2nd parameter in dismiss you do
I do
otherwise don't know. Have you check that it's effectively beta.11 which is installed and not an older one (like a old hash in package-lock or something while installing)? |
Yeah, I've wiped package-lock.json, rm -rf node_modules, etc and called |
I remember having this issue. @nikhildev check your routing file to see if the route to your modal page was not added automatically. Also in the module file the |
@nikmartin the source code of your app is public? like I said above it still works fine for me, I could open/close etc. modals in beta.11 no problemo |
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. |
After updating to Ionic 4.0.0-beta.5, I get the following error when calling
dismiss()
on aModalController
when I click on a button:Closing the modal through the backdrop works normally.
The text was updated successfully, but these errors were encountered: