fix(ion-tabs): preserve route navigation extras when changing tabs#18493
Conversation
|
Hi Ionic Team, you're doing an amazing job and I know are absolutely flat out. I'm just wondering if I can do anything else to help review this pull request so it can be approved and merged? Thanks a million! |
|
Thanks for the PR! We appreciate all the work you put into this. I think my main concern is changing what I am in favor of fixing this issue, but it might have to wait until the next major release of Ionic as we only do breaking changes in major releases. I will post in this thread when I have more to share. Thanks! |
|
Thanks for the feedback!! Would it help if I updated the PR to include a new api that returns the RouteView, leaving getLastUrl to return a string? This would not introduce a breaking change and fix the bug at the same time.
I’m happy to do this if you think it would work.
Cheers,
James
… On 7 Aug 2019, at 10:50 pm, Liam DeBeasi ***@***.***> wrote:
Thanks for the PR! We appreciate all the work you put into this.
I think my main concern is changing what getLastUrl returns. This PR changes the return from a string to a RouteView which might be considered a breaking change for users that directly access IonRouterOutlet in their apps.
I am in favor of fixing this issue, but it might have to wait until the next major release of Ionic as we only do breaking changes in major releases. I will post in this thread when I have more to share.
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@liamdebeasi what about #18740, which fixes the same problem however does not introduce a breaking change? |
|
Sorry for the delay in replying! What I'm thinking is we can add this change, but add it as a new method and update internal references to use this method. We would still have the old method, but we can mark it as deprecated. This will let us avoid a breaking change while still fixing the issue. |
Reinstate getLastUrl to return a string for backwards compatability and add a new method getLastRouteView to return a RouteView complete with route navigation extras (query params and fragments)
|
Hi @liamdebeasi I made time to look at this again and have restored |
|
Thanks for making the changes! I found a small bug in the PR. Here are steps to reproduce:
Other than that, this PR appears to be working properly. |
|
Hi @liamdebeasi I spent some today reviewing this carefully. I have updated the PR to take into account going to the root tab view and respecting the url extras. I have added documentation https://github.com/ionic-team/ionic/pull/18493/files#diff-891ce68da9d3204cb1a1870a225e5350R69 to describe different scenarios wrt tab navigation. |
|
PR has been merged. Thank you! |
Is there a version of |
|
The fix was only released with v5.0. Sorry.
… On 11 Jul 2020, at 5:45 am, Jeremy Lopez ***@***.***> wrote:
PR has been merged. Thank you!
Is there a version of @ionic/angular that contains this fix? I'm running 4.11.10 right now and selecting a new tab does not show this behavior. Or perhaps I'm missing something...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build) was run locally and any changes were pushednpm run lint) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
When using ion-tabs in an angular app, changing tabs doesn't restore the previous route navigation extras, such as Query Params or URL Fragments.
I haven't checked this behaviour in the react or vue distributions.
Issue Number: #18717
What is the new behavior?
This is a bug fix so that when changing tabs, any previous route navigation extras are restored.
Please note, this PR is only for @ionic/angular and not React or Vue projects.
Does this introduce a breaking change?
Other information