-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: IonRouter's navigate() pop/back not working after displaying more than 2 ion-tab pages #27443
Comments
Thanks for the issue. I am going to close this as a duplicate of #25213. |
@liamdebeasi I'm not sure if this is completely related (to be honest, it's hard to follow what's going on on #25213 videos as we don't really see where user clicks and what are the URLs involved) I'd say there are 2 differences :
|
There are a few issues here. The first is #25213. This is a bug where trying to go back within a tab does not render the correct view due to how the histories for each tab managed internally. The second issue is the current UI implementation is not really how tabs are supposed to be used. A back button within a tab should always work within the tab itself, and it should never take you out of the tab. For example, a back button inside If you want a global header that brings users back to the root non-tab page, then the header should be placed in The third issue I see in For example, if the current route position is 14, and the position of the original |
Thanks a lot Liam for your detailed response, that's very valuable !
Putting That being said, I was able to confirm that by moving back Wow, I just learned that the |
…tabs parent page instead of directly from current-event-header component this fixes bug described here: ionic-team/ionic-framework#27443
FYI, I found a workaround to my problem by :
|
…tabs parent page instead of directly from current-event-header component this fixes bug described here: ionic-team/ionic-framework#27443
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. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
In a Non-Linear Routing scenario, when I navigate to a tabbed view, then navigate on multiple tabs, I'm not able to pop the tabbed view from the history as soon as I switched to more than 2 different tabs (if I switch between 2 tabs, I'm not facing any issue)
This can be pinpointed by following video
Following navigation is ✅ :
[event-selector]
--(select event | push)--> [event schedule]
--(back button clicked | pop) --> [event-selector]
Following navigation is ✅ too :
[event-selector]
--(select event | push)--> [event schedule]
--(switch on tab favorites | ??? (not sure if push or replace)) --> [event favorites]
--(back button clicked | pop) --> [event-selector]
Now, if I had a third tab navigation, it is failing ❌ :
[event-selector]
--(select event | push)--> [event schedule]
--(switch on tab favorites | ??? (not sure if push or replace)) --> [event favorites]
--(switch on tab feedback | ??? (not sure if push or replace)) --> [event feedbacks]
--(back button clicked | pop) --> ❌ [event-selector]
Note that the problem seems related to the number of different visited tab pages : if I keep 3 jumps on tabs, but I only visit 2 (and not 3) different tab pages, then it is ✅ too :
[event-selector]
--(select event | push)--> [event schedule]
--(switch on tab favorites | ??? (not sure if push or replace)) --> [event favorites]
--(switch back tab schedule | ??? (not sure if push or replace)) --> [event schedule]
--(back button clicked | pop) --> [event-selector]
Expected Behavior
Whatever the number of tab switches, a call to :
should remove tabbed view from the history stack.
Steps to Reproduce
git clone -b router-pop-issue-on-tabs-repro https://github.com/voxxrin/voxxrin3.git && cd voxxrin3/mobile/
node@18+
) :npm ci
/event-selector
You can use this video to help you navigate into the app
Code Reproduction URL
https://github.com/voxxrin/voxxrin3
Ionic Info
Additional Information
My website navigation is made of following pages :
Here is my router config :
Navigation from /event-selector to /events/:eventId/* page is made through a
push
+forward
router navigation :On every /events/:eventId/* pages, I have a header component allowing to navigate back to the /event-selector page with
pop
+back
router navigation :My tabs are declared normally, using
<ion-tab-button>
withhref
navigation links :The text was updated successfully, but these errors were encountered: