Skip to content

bug: routing with angular [queryParams] breaks subsequent relative navigations #24587

Closed

Description

@adeprez

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

With Angular, when using ion-router-outlet as navigation root, relative navigation breaks if we use [routerLink] with a relative route combined with any [queryParams] value. After the first one, all other relative routes would not trigger navigation anymore.

Expected Behavior

The ion-router-outlet should behave like the angular's router-router : relative navigation is still possible once we navigated with query params.

Steps to Reproduce

I made a simple repro : https://stackblitz.com/edit/ionic-angular-v5-xjfgnp?file=src/app/dummy.component.ts
You can switch from Ionic to Angular router outlet using the top toggle button.

Once you click on the second link Stay on route 1 with query params with ion-router-outlet, relative navigation to other routes is broken and 3rd link will not trigger navigation anymore.

The same actions with Angular router-outlet would still work.

Code Reproduction URL

https://github.com/adeprez/ionic-angular-v6-relative-nav-issue

Ionic Info

No response

Additional Information

No response

Activity

  1. self-assigned this
    on Jan 18, 2022
  2. sean-perkins commented on Jan 18, 2022

    @sean-perkins
    Contributor

    @adeprez thanks for reporting this issue!

    I see that when using ion-router-outlet and routing to a route with query parameters, the other router link href is being updated to /. This behavior is inconsistent with router-outlet, where the router link is untouched when navigating to a route with query params.

    We will log this issue as a bug and prioritize, thanks!

  3. added
    package: angular
    type: bug
    on Jan 18, 2022
  4. removed their assignment
    on Jan 18, 2022
  5. EssyTech commented on Feb 15, 2022

    @EssyTech

    I have experienced this issue today and have resorted to remove query params and solve the route params using a different method (storage). Seems to work fine in web but not on tablets and phones, at least in the emulated ones. I have updated to 6.0.7 and still had the issue.

  6. added a commit that references this issue on Oct 9, 2026
    6b5afec
  7. ionitron-bot commented on Nov 8, 2026

    @ionitron-bot

    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.

  8. locked and limited conversation to collaborators on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: angulartype: bug

    Type

    Fields

    Stage

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions