bug: Ionic navigation query param bug
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
https://github.com/user-attachments/assets/5f1f8f50-27dd-4d57-ac23-780aa839e03e
For some reason the parent page inherit the nested route query params if you navigate the tabs in a certain way.
Expected Behavior
The ionic navigation should not apply query params from nested pages to the parent page.
Steps to Reproduce
https://github.com/user-attachments/assets/5f1f8f50-27dd-4d57-ac23-780aa839e03e
I've made a basic ionic demo project with tabs and only added the nested page "foo" and a button to push the new route.
- Clone this repo https://github.com/rishoej/ionic-navigation-query-param-bug/tree/main and
run npm iandnpm run dev - Click the button "Go to nested page"
- The url is "/tabs/tab1/foo?foo=bar" (which is intended)
- Click Tab1 in the navigation, so you return to the parent route "/tabs/tab1"
- Click Tab2 in the navigation
- Click Tab1 again and it will now somehow inherit the previous query param "/tabs/tab1?foo=bar"
Code Reproduction URL
https://github.com/rishoej/ionic-navigation-query-param-bug/tree/main
Ionic Info
Ionic:
Ionic CLI : 7.2.0 (/Users/trqj/homebrew/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/vue 8.3.3
Capacitor:
Capacitor CLI : 6.1.2 @capacitor/android : not installed @capacitor/core : 6.1.2 @capacitor/ios : not installed
Utility:
cordova-res : not installed globally native-run : 2.0.1
System:
NodeJS : v21.6.2 (/Users/trqj/homebrew/Cellar/node/21.6.2/bin/node) npm : 10.2.4 OS : macOS Unknown
Additional Information
No response
Source: ionic-team/ionic-framework