Skip to content

fix(vue): prevent tab buttons from navigating without a router outlet - #31834

Open
thetaPC wants to merge 1 commit into
mainfrom
FW-8015
Open

thetaPC wants to merge 1 commit into
mainfrom
FW-8015

Conversation

@thetaPC

@thetaPC thetaPC commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Issue number: internal


What is the current behavior?

In Vue, when IonTabs has IonTab children instead of an IonRouterOutlet, clicking the tab that's already selected can navigate the app to a different page. This happens when the router history has an entry for a router-outlet tab with the same tab name. For example, the app visits /tabs/tab1, pushes a page with routerless tabs, and the user then clicks the selected Tab 1. The URL goes back to /tabs/tab1.

IonTabButton calls resetTab() on the router even when there's no router outlet. resetTab() finds the other tabs' history entry and navigates back to it. Clicking a different tab doesn't navigate, because changeTab() returns early when the path is empty.

What is the new behavior?

  • Without a router outlet, IonTabButton no longer calls the router, so clicking a tab never changes the URL. Tabs with a router outlet are unchanged.
  • A new e2e test opens the router-outlet tabs, pushes /tabs-basic, clicks the selected tab, and checks that the URL stays the same.

Does this introduce a breaking change?

  • Yes
  • No

Other information

N/A

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 26, 2026 3:48am UTC

Request Review

@github-actions github-actions Bot added the package: vue @ionic/vue package label Nov 26, 2026
@thetaPC
thetaPC marked this pull request as ready for review November 26, 2026 04:05
@thetaPC
thetaPC requested a review from a team as a code owner November 26, 2026 04:05
@thetaPC
thetaPC requested a review from ShaneK November 26, 2026 04:05

This branch was successfully deployed

1 active deployment
Preview — 757fcbbf Deployed Nov 26, 2026 by vercel[bot]
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.

1 participant