Anyone seeing Modal issues with 2.0 beta 8?


#1

I’ve move an app to 2.0 beta 8 and while inset modals were working before I’m now seeing that they don’t appear until after I can one of the app tabs, then the Modal presents itself. Anyone else seeing this?


#2

Hello! am having the same modal issue (modal not showing on view) with 2.0 beta 8, and there is no error been shown on log. how can I solve this? should I downgrade to beta 7?


#3

Was beginning to think it was just me. Haven’t found a solution so far. For me it is with inset Modal, not sure if every type of Modal is affected, might only be when used with tabs navigation?

Tagging @adam have you seen this before? It’s like the zone microtask doesn’t fire until a much later action causes the task queue to be processed.


#4

@webprofusion Could you open an issue about this, so that it’s tracked and reviewed?


#5

Found the solution for me: Before I was opening the Modal I was calling a local service Observable to get the model for the item being displayed:

    this.poiManager.getPOIById(args.poiId, true).subscribe(poi => {

        let poiDetailsModal = Modal.create(POIDetailsPage, { item: poi });
        this.nav.present(poiDetailsModal);

    }, (err) => {

        this.appManager.showToastNotification(this.nav, "POI Details not available");
    });

Turns out if I wrap it in a NgZone.run it works now (with zone being an NgZone injected in the page constructor):

  this.zone.run(() => {
    // ...
    // ...
  }

#6

I’d say that it’s rather a workaround for a problem existing somewhere in your project:

In case that you updated your project from an earlier version of the framework I would suggest to check if you performed the update properly. If you missed something by the update, it might result in such problems. Check out the following post for more details:

However if you’re sure that you updated your project correctly then this behavior might be related to the following problem with Observables and zone.js (which should be fixed by now):


#7

Thanks for looking into this in such detail, I’ll need to give up on it for now. I don’t have the extraneous es6-shim import and as far as I can tell I’m using the same version of everything relevant as the latest starter templates.

The work in progress source for this app is at:

And the working(-ish) app is here:
https://api.openchargemap.io/map

You’re correct that I’m seeing issues elsewhere. Nav Controllers that won’t .pop() the current open modal for instance.


#8

You should dismiss() a Modal using the ViewController instead. This is valid for Modals and all other components that are displayed with NavController.present() (e.g. Alerts, ActionSheets, etc). You should use NavController.pop() for components that are shown using NavController.push().