Tab reloading while double click the tab


#1


I have the same problem,how to avoid reloading tabs while double click the tab ???


#2

They fixed that issue and will releases it with Ionic 3.1.0


Capturing ion-tab click on active tab event
#3

ok , I got it ,thank you~


#4

Hi!
How did this solve the problem?


#5

I add the code below to my tab page.solved my problem.

  ionViewCanEnter(){
    if(undefined!=this.navCtrl.getActive())
    {
      if(this.navCtrl.length()==1)
          return false;
    }
  }

#6

Hi, thanks for replying!

I tried to implement your code, but it gives me an error:

Runtime Error
Uncaught (in promise): false
Stack
Error: Uncaught (in promise): false
at g (http://localhost:8100/build/polyfills.js:3:7133)
at l (http://localhost:8100/build/polyfills.js:3:6251)
at http://localhost:8100/build/polyfills.js:3:5607
at http://localhost:8100/build/polyfills.js:3:17487
at t.invoke (http://localhost:8100/build/polyfills.js:3:14529)
at Object.onInvoke (http://localhost:8100/build/main.js:4424:37)
at t.invoke (http://localhost:8100/build/polyfills.js:3:14469)
at n.run (http://localhost:8100/build/polyfills.js:3:9741)
at http://localhost:8100/build/polyfills.js:3:6774
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15213)
at Object.onInvokeTask (http://localhost:8100/build/main.js:4415:37)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15134)
at n.runTask (http://localhost:8100/build/polyfills.js:3:10390)
at a (http://localhost:8100/build/polyfills.js:3:5313)
at

Do you have any idea what it might be?

Thanks!


#8

Could you show me all the code of your .ts file?..


#11

Go edit tabs.ts in node_modules/ionic-angular/components/tabs/ at line 469

 if (viewController.component !== active.component) {
     // Otherwise, if the page we're on is not our real root
      // reset it to our default root type
      return tab.setRoot(tab.root);
 }

#12

Hi, the "ionic-angular" folder does not exist on my node-modules folder.


#13

Hey, I found the folder and change the file as you said but it did not work …


#14

Did you try ionic serve again?


#15

They released Ionic 3.1 so just update to 3.1: Guide: How to update to Ionic 3.X


#16

Thanks man you solved my problem!! :grinning: