Skip to content

defaultIndex on <TabGroup> is not reactive in Vue #3806

@valgeirb

Description

@valgeirb

When using the Vue component with the :defaultIndex prop, the value is only applied once on mount and does not update when the bound ref changes. This makes it impossible to dynamically change the default tab after initialization.

For comparison, using :selectedIndex works as expected and updates reactively when the bound ref changes.

Steps to reproduce:

  1. Bind a ref to :defaultIndex on <TabGroup>.
  2. Change the ref after mount (e.g., with a setTimeout).
  3. Observe that the selected tab does not update.

Expected behavior:

When the bound value changes, the selected tab should update accordingly, similar to :selectedIndex.

Minimal reproduction:

CodeSandbox repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions