-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Open
Labels
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
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
- Initialize a new Ionic project using the tabs template:
ionic start project tabs
This installs Ionic 7 by default.
- Add a listener for the
ionTabsDidChangeevent in the IonTabs component and include aconsole.log()to verify the event is triggered.
<IonTabs onIonTabsDidChange={(e) => console.log('onIonTabsDidChange', e.detail.tab)}>
...
</IonTabs>
-
Confirm that the event works as expected by running the project.
-
Upgrade to Ionic 8 by running:
npm i @ionic/react@8 @ionic/react-router@8
- Run the project again and observe that the
ionTabsDidChangeevent 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
jramosg, JoongWonSeo, ohmycode, oliveryasuna and msio