Skip to content

ionViewCanLeave() breaks navigation on second call, causes blank screen #8408

Closed
@sjdrew

Description

@sjdrew

ionic 2.0.0-RC0

The new ionViewCanLeave() breaks navigation. If user tries to go back once, it is blocked fine, however if on the second try of the back button also returns false, then when eventually returns true the navigation is broken and a blank white page displays.

Easy to produce, just create tutorial app via

ionic start MyIonic2Project tutorial --v2

Then add this code to the item-details.ts file, ItemDetailsPage class:

    public trys = 0;
    ionViewCanLeave(): any {
        if (this.trys++ < 2) {
            return false;
        } else return true;
    }

Then serve the app and click to item list page, then click on a row to view item-detail page, then click back button 3 times. You will end up with blank white page.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions