Skip to content

Tab of b-tab-items bound to an array stays in tab nav when removed from array #241

Description

@daenuprobst

Overview of the problem

Buefy version: [0.5.0
Vuejs version: 2.4.2
OS/Browser: Ubuntu 16.04.3 / Firefox, Chrome, Chromium

Description

When b-tab-items are "bound" to an array items like

<b-tabs v-model="activeTab" type="is-boxed">
  <b-tab-item v-for="item in items" :label="item.title">
    <div>{{ item.content }}</div>
  </b-tab-item>
</b-tabs>

and an element is removed from the array

remove: function(index) {
  this.items.pop(index);
}

The content is removed, however the tab ("header") stays in the nav.

Steps to reproduce

  1. Setup a b-tabs elements as shown in the description.
  2. Create a button which calls the function remove as shown in the description.
  3. Use the button to remove elements from the array.

Expected behavior

The b-tab-item should be completely removed.

Actual behavior

The content of b-tab-item is removed, however the tab "head" is still in the nav element and can also be clicked / activated.

Activity

  1. changed the title [-]Tab of b-tab-items bound to an array stay in tab nav when removed from array[/-] [+]Tab of b-tab-items bound to an array stays in tab nav when removed from array[/+] on Aug 11, 2017
  2. jtommy commented on Aug 12, 2017

    @jtommy
    Collaborator

    @daenuprobst thanks. It's fixed but you have to remember to update bTabs v-model value after remove.

  3. daenuprobst commented on Aug 12, 2017

    @daenuprobst
    Author

    Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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