Nav.getActive() returns null if an overlay is shown
See original GitHub issueShort description of the problem:
When I present an overlay (alert, popover etc.), the app’s NavController method getActive
returns null.
What behavior are you expecting?
I don’t know whether it should return the underlying page or the active overlay, but returning null seems like a bug to me, especially when it returns the active page before the overlay is shown.
It seems to me that it should return the active overlay, becuse nav.isActive(overlay)
returns true.
Steps to reproduce:
- Present an overlay and wait for it’s promise
- Check the return result of
app.getActiveNav().getActive()
app.getActiveNav().getActive(); // returns ViewController with the current page
alert.present().then(() => {
app.getActiveNav().getActive(); // returns null
app.getAciveNav().isActive(alert); // returns true
});
Which Ionic Version? 1.x or 2.x 2.0.0-beta.11
Run ionic info
from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
OS:
Node Version: v6.2.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Nav.getActive() returns null if an overlay is shown · Issue #7609
Short description of the problem: When I present an overlay (alert, popover etc.), the app's NavController method getActive returns null.
Read more >Ionic 3 : Close modal with phone's back button - Stack Overflow
nav.getActive().instance : null; if (page && page.isRootPage) { Logger.
Read more >NavController - Ionic API Documentation
Inserts an array of components into the nav stack at the specified index. The last component in the array will become instantiated as...
Read more >leaflet - getActiveLayers for LeafletJS - GIS Stack Exchange
This plugin contains methods getActiveBaseLayer() and getActiveOverlayLayers() . The following, from vogdb's github page, demonstrates how ...
Read more >Scripting API: RenderTexture.active - Unity - Manual
If the active RenderTexture is null everything is rendered in the main window. ... render texture RenderTexture.active = currentActiveRT; return tex; } } ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please remove me from conversations of your development !!! I have nothing to with your company and your spamming mail with tens of mails a day. PLEASE STOP SENDING ME THESE MAILS !!!
On Aug 13, 2016 7:25 PM, “Jakub Beránek” notifications@github.com wrote:
Actually this is a problem and should be fixed in my opinion.
Example/usecase: our app is checking for some settings/whatever in the background (using setInterval). And when this check returns TRUE we want to show modal with some info. So the problem is app will be broken in case of another overlay is active at the moment. What can we do in such cases? I thought about using
getActive().isOverlay
flag, but it doesn’t work 😕