Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: double tap a tab then go to a global page, back button missing and swipe back broken #19943

Closed
peterzhang41 opened this issue Nov 18, 2019 · 16 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@peterzhang41
Copy link

Bug Report

Ionic version:
[x] 4.11.5

Current behavior:
using Angular router.navigate(), double-tap a tab then go to a global page, back button missing and swipe back broken

Expected behavior:
back button still appears, and swipe back gesture still working

Steps to reproduce:

1.run it
2.tap twice the tab
3.click the global page button
4.check the back button

Related code:

A sample application via GitHub
https://github.com/peterzhang41/ionicDoubleTapTabIssue

Other information:
our team has to use NavController instead

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.6 (/home/zehui/.nvm/versions/node/v10.17.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.11.5
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 4 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.9 

System:

   Android SDK Tools : 26.1.1 (/home/zehui/Library/Android/Sdk)
   NodeJS            : v10.17.0 (/home/zehui/.nvm/versions/node/v10.17.0/bin/node)
   npm               : 6.13.0
   OS                : Linux 4.15

@ionitron-bot ionitron-bot bot added the triage label Nov 18, 2019
@wilk-polarny
Copy link

See: #19293 and #18455

@DavidStrausz
Copy link
Contributor

I think this is the same issue as described here: #19455, you can find my workaround in the comments which works fine for me. Unfortunately the author already closed the issue.

@wilk-polarny
Copy link

@DavidStrausz , keep in mind that the old window stack system (with the nav controller) is deprecated and will likely be removed in a future version

@tofra
Copy link

tofra commented Dec 16, 2019

I'm encountering the same issue. Double click on a tab will prevent the back button to display on the "next" page. :-(

@wilk-polarny
Copy link

wilk-polarny commented Jan 23, 2020

Cannot reproduce anymore on 4.11.8 or newer. Can anyone confirm?
nvm, it's still there

@peterzhang41
Copy link
Author

peterzhang41 commented Feb 3, 2020

Cannot reproduce anymore on 4.11.8 or newer. Can anyone confirm?

@ionic/angular@4.11.10 still be able to replicate, and it seems to be even worse now as one tap can also reveal it. Lol

@rastafan
Copy link

I can confirm this is still an issue in 5.4.11. Tapping 2 or more times on a tab-button breaks back button on the next navigation. Any fix/workaround for this?

@wilk-polarny
Copy link

Yup, funny thing is that I cannot reproduce this using the Ionic Conference Starter, but with other apps. The only difference is in the way (angular) routing is set up. Haven't nailed it down yet, but something gets messed up when tapping a tab button while already being on the root page for the tab - on consecutive navigations within the tab, the previous component will be destroyed (ngOnDestroy called), and thus there is no back button available. we had to hard code back button hrefs because of that - still, the animation is messed up due to the routing issues.

@liamdebeasi , we experience this bug since 4.x - any chance someone might take a look at this?

@rastafan
Copy link

As stated in #19455 , setting this.navController.setDirection('forward'); before calling this.router.navigate(['some',path]); actually seems to solve the issue.
Should we use navController.navigateForward instead of router.navigate to navigate through the app, in order to avoid this problem?

@wilk-polarny
Copy link

wilk-polarny commented Mar 26, 2020

At least since Ionic 4 you shouldn't use the navController at all and use Angular Routing (if you use Angular) - the old nav controller is deprecated

@wilk-polarny
Copy link

wilk-polarny commented Apr 10, 2020

I guess this has something to do with the routing - together with componentless routes and redirects and/or the way navigation happens when tapping an already open tab with its root component being displayed. Lazy loaded routes and componentless modules seem to play a role here (with components being destroyed even though they shouldn't - breaking navigation) - I am able to work around this by moving some child routes into the tab routing module.
I'm currently investigating and trying to nail this down a bit more.

@liamdebeasi
Copy link
Member

Hi everyone,

This looks to be the same issue as #21074. There is a dev build in #21074 (comment) if people are interested in testing a fix out (requires Ionic 5.0+).

Thanks!

@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Apr 22, 2020
@liamdebeasi liamdebeasi added this to the 5.1.0 milestone Apr 22, 2020
@ionitron-bot ionitron-bot bot removed the triage label Apr 22, 2020
@liamdebeasi
Copy link
Member

Thanks for the issue. This has been resolved via #21085, and a fix will be available in an upcoming release of Ionic Framework.

@tofra
Copy link

tofra commented Apr 27, 2020

Is this also being ported to ionic 4?

@liamdebeasi
Copy link
Member

This fix will not be ported to Ionic 4. Ionic 4 is only receiving critical security fixes moving forward.

@ionitron-bot
Copy link

ionitron-bot bot commented May 27, 2020

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

6 participants