NavController.push() unfamiliar behaviour


#1

I am using following code for going from one page to another but sometime I will see the elements of earlier pages into current page.I also remove page from the stack.

this.navCtrl.push(SecondPage, {
                          key: this.key
                    }).then(() => {
                        const index = this.viewCtrl.index;
                        for (let i = index; i >= 0; i--) {
                            this.navCtrl.remove(i);
                        }
                    });

#2

Am I correct that you’re trying to make it impossible for the user to navigate back to an old page by removing them all from stack?


#3

Yes, but even calling navCtrl.remove() method I can still see html view of previous pages into the current page. E.g. some button see in background of earlier page into current page.


#4

Have you tried using navCtrl.setRoot(‘page’)?


#5

Yes, I tried it work fine for pages navigation but I still get Modal content in background of some pages.