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.

v4: creating a loading without presenting makes the view unclickable

See original GitHub issue

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 called

Steps to reproduce:

  1. Create a loading with `await this.loadingCtrl.create({…})
  2. Done

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.5.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.17
   @angular-devkit/build-angular : 0.10.7
   @angular-devkit/schematics    : 7.0.7
   @angular/cli                  : 7.0.7
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : none
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, (and 5 other plugins)

System:

   ios-deploy : 1.9.4
   ios-sim    : 7.0.0
   NodeJS     : v10.11.0 (/usr/local/Cellar/node/10.11.0/bin/node)
   npm        : 6.4.1
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
manucorporatcommented, Dec 28, 2018

Would it be possible to just not attach the overlay to the DOM until present is called?

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.

1reaction
zakton5commented, Dec 16, 2018

@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:

  1. Transition takes longer than 250 ms
  2. Create the loading overlay
  3. Transition finished (cancel overlay with my own code logic)
  4. Create overlay finished
  5. My own code sees that it is cancelled and so I do not present the overlay.
  6. Problem described above

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Making layout unclickable - Stack Overflow
So when Child2 becomes visible all the View that are present of Child1 should become unclickable and only View on child2 be clickable....
Read more >
How To Deal With "Element is not clickable at point” Exception ...
In this section of the Selenium Java tutorial, let us understand the major causes of the “Element is not clickable at point” exception....
Read more >
How to Disable Links | CSS-Tricks
A disabled link is not a link, it's just text. You need to rethink your design if it calls for disabling a link....
Read more >
How to Fix Selenium's "Element Is Not Clickable at Point"
The solution is to make sure that the overlapping element is closed before you try to click on another element. Another solution is...
Read more >
In Powerpoint how to make text appear one by one - YouTube
This video shows you how to make text, bullet points or images appear one by one in Powerpoint, either automatically or when clicking...
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