Skip to content

fix(vue-router): remove parameterized tabs page after switching tabs - #31678

Open
ShryukGrandhi wants to merge 1 commit into
ionic-team:mainfrom
ShryukGrandhi:fix/issue-30435-bug-ionic-tabs-inside-dynamic-route-brea
Open

ShryukGrandhi wants to merge 1 commit into
ionic-team:mainfrom
ShryukGrandhi:fix/issue-30435-bug-ionic-tabs-inside-dynamic-route-brea

Conversation

@ShryukGrandhi

Copy link
Copy Markdown

Issue number: resolves #30435


What is the current behavior?

When the route that renders ion-tabs has a parameter (for example /dynamic/:id with child tabs a, b, c), the view stack identifies the tabs page by the full URL it was first created on, such as /dynamic/123/a. findViewItemByPath rejects any parameterized match whose path isn't exactly equal to the view item's pathname, so after visiting a third tab the leaving view lookup for /dynamic/123/c can't find the tabs page. Navigating away to / then never transitions the tabs page out, so it stays on top of the new page and blocks it.

What is the new behavior?

  • For parameterized routes, findViewItemByPath now compares only the params that belong to the matched route instead of the whole URL. /dynamic/123/a and /dynamic/123/c resolve to the same tabs page, while /dynamic/1/a and /dynamic/2/a (and leaf routes like /page/1 vs /page/2) still create separate view items as before.
  • Added a unit test in tabs.spec.ts that goes through three tabs of a /dynamic/:id tabs route and then navigates to /. It checks that the home page is visible and the tabs page is hidden.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Fixes #30435

Testing: I built core, @ionic/vue, and @ionic/vue-router, then built and synced the vue3 test app. The new test failed against the unpatched vue-router build because the home page stayed hidden. With the fix, the full Vitest unit suite passes (12 files, 74 tests). eslint and prettier --check pass for packages/vue-router. I didn't run the Cypress and Playwright e2e suites locally.

Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
@ShryukGrandhi
ShryukGrandhi requested a review from a team as a code owner November 1, 2026 23:23
@ShryukGrandhi
ShryukGrandhi requested a review from thetaPC November 1, 2026 23:23
@vercel

vercel Bot commented Nov 1, 2026

Copy link
Copy Markdown

@ShryukGrandhi is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the package: vue @ionic/vue package label Nov 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: ionic-tabs inside dynamic route breaks the app.

1 participant