Skip to content

Dynamically shown tabs appear out of order #1483

@blm768

Description

@blm768

Overview of the problem

Oruga version: 0.12.2 (also confirmed in 0.11)
Vuejs version: 3.5.18
OS/Browser: (all)

Description

When an OTabItem is dynamically shown, it will first appear at the end of the tab list. After 500 ms, it then jumps to its correct position in the tab order.

tabs.webm

Expected behavior

The item should show up in the correct location immediately.

Actual behavior

The item has to go through this debounced sort function before it shows up in the right place.

Steps to reproduce

See the following example component:

<script setup>
import { ref } from "vue";
const showFirstItem = ref(false);
</script>

<template>
  <OTabs>
    <OTabItem
      v-if="showFirstItem"
      label="First"
    >
      First Item
    </OTabItem>
    <OTabItem label="Second">
      <OButton @click="showFirstItem = !showFirstItem">Show First Item</OButton>
    </OTabItem>
  </OTabs>
</template>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions