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

bug: ionTabsDidChange event not triggering in Ionic 8 (React) #30145

Open
3 tasks done
sergioadimedia opened this issue Jan 22, 2025 · 0 comments
Open
3 tasks done

bug: ionTabsDidChange event not triggering in Ionic 8 (React) #30145

sergioadimedia opened this issue Jan 22, 2025 · 0 comments
Labels

Comments

@sergioadimedia
Copy link

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

The ionTabsDidChange event does not trigger in Ionic 8. This issue does not occur in Ionic 7, where the event triggers as expected.

Expected Behavior

The ionTabsDidChange event should trigger in Ionic 8 when a tab is changed, just as it does in Ionic 7.

Steps to Reproduce

  1. Initialize a new Ionic project using the tabs template:
ionic start project tabs

This installs Ionic 7 by default.

  1. Add a listener for the ionTabsDidChange event in the IonTabs component and include a console.log() to verify the event is triggered.
<IonTabs onIonTabsDidChange={(e) => console.log('onIonTabsDidChange', e.detail.tab)}>
...
</IonTabs>
  1. Confirm that the event works as expected by running the project.

  2. Upgrade to Ionic 8 by running:

npm i @ionic/react@8 @ionic/react-router@8
  1. Run the project again and observe that the ionTabsDidChange event no longer triggers when switching tabs.

Code Reproduction URL

https://codesandbox.io/p/sandbox/purple-hooks-tsmpmp

Ionic Info

Ionic:

Ionic CLI : 5.4.16 (C:\Users\sergio\AppData\Local\npm-cache_npx\864a9e3c2cd0cf50\node_modules\ionic)
Ionic Framework : @ionic/react 8.4.1

Utility:

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

System:

NodeJS : v18.19.0 (C:\Program Files\nodejs\node.exe)
npm : 10.2.3
OS : Windows 11

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant