question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[4.0.0-rc.3] Back button not working with tabs

See original GitHub issue

Bug Report

Ionic version: 4.0.0-rc.3

Current behavior: In the new RC, upon clicking the hardware back button in a tab, it does not go to the previous tab as before

Expected behavior: It should either go to home tab, or to previous tab

Steps to reproduce: See behavior.

Related code:

Other information:

Ionic info:

insert the output from ionic info here

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
manucorporatcommented, Jan 24, 2019

NavController in V4 is just a thin wrapper on top of Angular Router, it does not replace it. It is just useful when you want a fine control over the animations (transitions) and stack.

Stack, you can go forward and backward, pushing or popping pages from the DOM. How do you control it? Using the angular router.

BUT if you want fine control, NavController exposes additional APIs for you to control it.

Tabs is a good use case, take a iOS native app, imagine you navigate forward in a tab and now you switch to a different tab. The “navigation” performed in the first tab is still there when you go back, that’s what the “stack” does for you.

The stack is handled automatically by Ionic when using the Angular Router.

There is a confusion between v3 NavController and v4 NavController:

  • V3: NavController was <ion-nav>
  • V4: NavController is an Angular providers that wraps the angular’s router.

Source code is the best documentation: https://github.com/ionic-team/ionic/blob/master/angular/src/providers/nav-controller.ts#L183-L190

Thanks for the feedback, this helps a lot to understand what things are confusing and we can focus our efforts to improve the documentation of this parts of Ionic!

Going to close this issue, since github issues are not intended for support purposes.

2reactions
paulstelzercommented, Jan 23, 2019

I invited a member of the official Ionic team to this topic, he will tell you more information about it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

[4.0.0-rc.3] Back button not working with tabs #17219 - GitHub
Bug Report Ionic version: 4.0.0-rc.3 Current behavior: In the new RC, upon clicking the hardware back button in a tab, it does not...
Read more >
ionic 4 - android back button not working for tab-bar routes
I'm expecting to go back to previous navigated page/tab. It looks like the router is not considering routes inside tabs page. My app.routes...
Read more >
Tab | React Native Elements
This is documentation for React Native Elements 4.0.0-rc.3, which is no longer actively maintained. For up-to-date documentation, see the latest version (4.0.
Read more >
Back button not working after extension opens new URL
Hi all! I'm seeing an issue with the Back button when an extension opens new URLs. Here's the scenario: 1. User has a...
Read more >
The Back button/action will not return to first page opened on a ...
When I navigate to the second webpage in that tab via a link, manual entry or bookmark, the Back button does not become...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found