-
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
v4: creating a loading without presenting makes the view unclickable #16685
Comments
Why are you creating the overlay if you are not presenting it? |
@manucorporat I have the following scenario: I want to transition to another page which uses a resolver that makes an http request. The point of the resolver is to wait until the data has been retrieved before navigating to the page. This could take a few seconds if the network is slow. So I decided to create a loading overlay that displays if the page transition takes longer than 250ms for whatever reason. However, the problem occurs when the following happens:
I could probably display the loading on every page transition, but I don't want to do that. I feel that loading overlays should be used for long running tasks, not simple page transitions that are capable of loading the data quickly. Having the option to display a loading overlay only when the network is slow is very desirable. |
Would it be possible to just not attach the overlay to the DOM until |
There used to be a delay property for loading, which I miss. Maybe this is a reason to bring it back. |
@PatrickMcD Yeah if a delay property was added that would solve my problem completely |
I have the same problem when my API call sometime can't load fast enough, I have to check is it still loading or not to show. |
Unfortunately not, components are not lazy loaded until attached to the DOM. @zakton5 i see, thanks for explaining it! what I don't understand is why the code that checks for calling present() can not also create() the overlay. |
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.x
Current behavior:
This is basically a duplicate of #15345 but the problem is still around. Creating a loading and then not presenting it still causes the backdrop to be visible and block user input.
Expected behavior:
I expect the backdrop to appear only after
present
is calledSteps to reproduce:
Ionic info:
The text was updated successfully, but these errors were encountered: