nuxt-modules / nuxt-modules/ionic

Tab not marked as selected on initial route

Open
#575 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
457
Forks
53
Avg merge
7h 32m
Merged PRs (30d)
21

Description

📚 What are you trying to do?

Hi,

according to docs you should set alias to / on the tab you wish to render instead of having index.vue in pages directory. That works fine as the tab gets rendered but the button in <ion-tab-bar> is not marked as selected. This doesn't work even in the modules playground project.

Does anyone know please how to fix that other than checking for route programatically and setting selected to true ?

🔍 What have you tried?

I've tried to change the href on <ion-tab-button> to / but that completely ruined the active tab detection. Furthermore, can some please explain to me how does it even work please ? Like ...when i set alias in define page meta on specific tab how does it know to render the parent component as well ? It's pretty unclear from the docs :(

ℹ️ Additional context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the initial-route case in the modules playground project using a tab with an alias of /, ion-tab-bar, and ion-tab-button. Compare the rendered tab with the active-tab detection and document the behavior that should mark the initial tab as selected without programmatic route checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.