Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

calculations in ionViewDidLoad and ionViewDidEnter block sidebar-menu from closing #534

Open
ionitron-bot bot opened this issue Nov 29, 2018 · 0 comments
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 29, 2018

Original issue by @znegva on 2017-12-18T06:57:13Z

Ionic version:
[ ] 2.x
[x] 3.x
[ ] 4.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request

Current behavior:

Doing heavy calculations during View Initialization does block the closing of the
ionic sidebar menu.
Neither using ionViewDidLoad nor when using ionViewDidEnter (which should
Runs when the page has fully entered and is now the active page. )
makes the sidebar close until the calculation is finished.

Expected behavior:
From my point of view the page is fully entered, when it is fully visible.

If you cannot avoid intense calculations while entering a page, it would be much
more user-friendly to show the page without fully loaded infos than to block the whole navigation (by keeping sidebar open).

My proposal/request is to not start ionViewDidEnter until the menu is closed.
Problems with this rather simple approach may occur when using
split pane mode.

Steps to reproduce:

A sample project demonstrating the problem can be found here.

The problem can be observed when entering Page1 (uses ionViewDidiLoad) or Page2(uses ionViewDidEnter) from the sidemenu.
A workaround using setTimeout(()=>{doStuff();},50); inside of ionViewDidEnter can be observed when entering Page3.

Related code:

https://github.com/znegva/ionic-sidemenu-issue

Other information:
The only way around this was to use setTimeout(()=>{doStuff();},50);, which
isn't a nice solution :)

Ionic info:

cli packages:

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.5
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2
    ios-sim           : 6.0.0
    Node              : v8.6.0
    npm               : 5.5.1
    OS                : macOS Sierra
    Xcode             : Xcode 9.2 Build version 9C40b
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

0 participants