Skip to content

bug: angular/react/vue, cannot set query param on tab buttons #25470

Closed

Description

@gooddaddy

Prerequisites

Ionic Framework Version

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

Current Behavior

<IonTabButton
              key={item.tab}
              tab={item.tab}
              href='/a?search=1'
              className={styles.tabButton}
            >
              <NavIcon selected={!!selected} icon={item} />
              <IonLabel>{item.label}</IonLabel>
            </IonTabButton>

'search will not be in location's href

Expected Behavior

'search' will be in location's href

Steps to Reproduce

<IonTabs>
      <IonRouterOutlet id="tabs">   
       <Route  exact={exact} path='/a' render={() => <UComponent />} />
     </IonRouterOutlet>
        <IonTabButton
              key={item.tab}
              tab={item.tab}
              href='/a?search=1'
              className={styles.tabButton}
            >
              <NavIcon selected={!!selected} icon={item} />
              <IonLabel>{item.label}</IonLabel>
    </IonTabButton>
   </IonTabBar>
</IonTabs>

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.19.1

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v16.14.2
npm : 8.5.0
OS : macOS Big Sur

Additional Information

企业微信截图_638f61fc-855c-44eb-85bb-781e00e76479

Activity

  1. self-assigned this
    on Jun 16, 2022
  2. liamdebeasi commented on Jun 21, 2022

    @liamdebeasi
    Contributor

    Thanks for the issue. Can you please provide your use case for setting query params on the initial tab page? At the moment we only support query params on inner tabs pages, not on the root tabs page when clicking IonTabButton.

  3. removed their assignment
    on Jun 21, 2022
  4. added and removed
    needs: replythe issue needs a response from the user
    on Jun 21, 2022
  5. gooddaddy commented on Jun 23, 2022

    @gooddaddy
    Author

    Thanks for the issue. Can you please provide your use case for setting query params on the initial tab page? At the moment we only support query params on inner tabs pages, not on the root tabs page when clicking IonTabButton.

    My web app needs to implement a dynamic page, the navigation bar is dynamically configured on the web side, tabbutton needs to jump to the specified page that requires more query parameters.

  6. changed the title [-]bug: IonTab props href which is contain 'search' did not work[/-] [+]bug: react, cannot set query param on root tab button[/+] on Jun 28, 2022
  7. changed the title [-]bug: react, cannot set query param on root tab button[/-] [+]bug: angular/react/vue, cannot set query param on tab buttons[/+] on May 11, 2023
  8. added
    type: buga confirmed bug report
    and removed
    type: buga confirmed bug report
    on May 11, 2023
  9. holvold commented on Oct 25, 2024

    @holvold

    What is the status on this? I'm working with these version of ionic in react, and the problem still exists.
    "@ionic/core": "7.6.3",
    "@ionic/react": "7.6.3",
    "@ionic/react-router": "7.6.3",

  10. added a commit that references this issue on May 20, 2026
    0182bba
  11. ionitron-bot commented on Jun 19, 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.

  12. locked and limited conversation to collaborators on Jun 19, 2026
  13. added a commit that references this issue on Oct 3, 2026
    73285ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions