-
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
bug: controller getTop() method returns overlays that are not presented #19111
Comments
Thanks for the issue. I can reproduce this behavior. The problem here is that This may have been intentional, but I think |
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. |
Bug Report
Ionic version:
[x] 4.7.4
Current behavior:
The call to
LoadingController.getTop()
returns the most recently created loading overlay even if it hasn't been presented/opened yet.Expected behavior:
According to the docs,, the call to
LoadingController.getTop()
should only return a loading overlay if it has already been presented/opened.Steps to reproduce:
LoadingController.getTop()
returns the second overlay instead of the first one.LoadingController.dismiss()
doesn't dismiss the open loading overlay and returns false.Related code:
https://github.com/damirarh/ioni4-loading-ctrl
Other information:
This behavior also makes it impossible to reliably close all opened loading overlays without having a reference to each opened instance (i.e. reimplement the behavior of
dismissAll
in Ionic 3) because there's no way to get to the previously opened loading overlay using theLoadingController
if an opened loading overlay was created afterward. I blogged about my attempt at implementingdismissAll
in Ionic 4.Ionic info:
The text was updated successfully, but these errors were encountered: