-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: SelectedTab on ion-tab-bar does not activate selected tab as default #20060
Comments
Looking at the tsx code in ion-tabs https://github.com/ionic-team/ionic/blob/master/core/src/components/tabs/tabs.tsx
See svelte example with dirty workaround in https://github.com/Tommertom/svelte-ionic-tab-routing-spa It would be very nice if a Alternatively you could offer three options in useRouter: |
Thanks for the issue! I can confirm that this is still an issue in the latest version of Ionic. I was able to replicate it in core (i.e. no framework). Thanks for the added dive into the potential cause; there might be a conflict between the code you mentioned in |
Hi - any update on this? @amandaejohnston Maybe you can point out how it is done in the Angular/Vue/React package of Ionic - so I can try to do this for svelte? In the source code? Happy to look it up |
Bug Report
Ionic version:
[x] 4.x
Current behavior:
Preferred tab as per property
selectedTab
when opening tabs is not selectedExpected behavior:
Preferred tab as per property
selectedTab
when opening tabs is selected (as per documentation).Steps to reproduce:
Take sample code as per
https://github.com/ionic-team/ionic-docs/tree/master/src/demos/api/tabs/index.html
and put in a separate file with extension html.Replace code
<ion-tab-bar slot="bottom">
with<ion-tab-bar slot="bottom" selectedTab="movies">
Open file in Chrome. Tab movies is not selected.
Related code:
See above
Other information:
Plain javascript file, no framework used. Same issue seems to appear when trying to set
selected="true"
on ion-tab-button.Related issue reported https://stackoverflow.com/questions/53860450/ionic-4-preselect-a-tab-in-a-modal. Using
selected-tab
as property does not work. Using JS is not desired (through controller).Ionic info:
The text was updated successfully, but these errors were encountered: