Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react, vue): add default value for navManager on tabs #29865

Merged
merged 7 commits into from
Sep 12, 2024
Merged

Conversation

thetaPC
Copy link
Contributor

@thetaPC thetaPC commented Sep 11, 2024

Issue number: N/A


What is the current behavior?

React: Refreshes the app upon a tab button press and returns to the first tab content.
Vue: Does not render the tabs when the app doesn't use a router at all because of ionRouter not being defined.

What is the new behavior?

  • React: Users can press on the tab button without having the app refresh and displays the associated tab content.
  • Vue: Renders the tabs when router is not present.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 8.3.1-dev.11726094383.1cdbab6f

How to test:
I recommend using the playgrounds in the Ionic Framework docs repo since those playgrounds are setup to not have any routers at a high level.

  1. Navigate to the basic usage section
  2. Select React
  3. Open the StackBlitz example
  4. Click on any tab button
  5. Notice that the app refreshes and returns to the first tab content
  6. Install the dev build: npm install @ionic/[email protected]
  7. Verify that the app doesn't refresh and reset the content after clicking on any tab button
  8. Navigate to the basic usage section
  9. Select Vue
  10. Open the StackBlitz example
  11. Notice that tabs doesn't render
  12. Open the console and notice that there's an error ionRouter is undefined
  13. Install the dev build: npm install @ionic/[email protected]
  14. Verify that it renders
  15. Verify that the console no longer shows the error

Copy link

vercel bot commented Sep 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 9:35pm

@thetaPC thetaPC changed the title fix(tabs): add check for navManager fix(react, vue): add default value for navManager on tabs Sep 11, 2024
@thetaPC thetaPC marked this pull request as ready for review September 11, 2024 23:44
@thetaPC thetaPC requested a review from a team as a code owner September 11, 2024 23:44
Copy link
Member

@tanner-reits tanner-reits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested reproduction steps and both cases look fixed!

@thetaPC thetaPC added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit df39cea Sep 12, 2024
65 checks passed
@thetaPC thetaPC deleted the ROU-11138 branch September 12, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: react @ionic/react package package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants