Skip to content

fix(v-tabs): recalculate overflow on tabs change#3728

Merged
johnleider merged 1 commit intomasterfrom
fix/#3643-dynamic-tab-overflow
Apr 1, 2018
Merged

fix(v-tabs): recalculate overflow on tabs change#3728
johnleider merged 1 commit intomasterfrom
fix/#3643-dynamic-tab-overflow

Conversation

@johnleider
Copy link
Copy Markdown
Member

Description

when the local tabs changes, re-evaluate overflow

Motivation and Context

fixes #3643

How Has This Been Tested?

jest

Markup:

<template>
  <div id="app">
  <v-app id="inspire">
    <v-tabs
      dark
      color="cyan"
      show-arrows
    >
      <v-tabs-slider color="yellow"></v-tabs-slider>
      <v-tab
        v-for="i in tabs"
        :key="i"
        :href="'#tab-' + i"
      >
        Item {{ i }}
      </v-tab>
      <v-tabs-items>
        <v-tab-item
          v-for="i in tabs"
          :key="i"
          :id="'tab-' + i"
        >
          <v-card flat>
            <v-card-text>{{ text }}</v-card-text>
            <v-btn @click.native="addTab">Add tab</v-btn>
            <v-btn @click.native="removeTab">Remove tab</v-btn>
          </v-card>
        </v-tab-item>
      </v-tabs-items>
    </v-tabs>
  </v-app>
</div>
</template>

<script>
export default {
  data () {
    return {
      text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
      tabs: 10
    }
  },
  methods: {
    addTab () {
      this.tabs = this.tabs + 1
    },
    removeTab () {
      this.tabs -= 1
    }
  }
}
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes, dev for new features and breaking changes).
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have created a PR in the documentation with the necessary changes.

when the local **tabs** changes, re-evaluate overflow

fixes #3643
@johnleider johnleider added the T: bug Functionality that does not work as intended/expected label Apr 1, 2018
@johnleider johnleider added this to the Sprint 9 milestone Apr 1, 2018
@johnleider johnleider self-assigned this Apr 1, 2018
@johnleider johnleider requested a review from KaelWD April 1, 2018 22:25
@johnleider johnleider merged commit 46c7335 into master Apr 1, 2018
@johnleider johnleider deleted the fix/#3643-dynamic-tab-overflow branch April 1, 2018 22:36
smiller171 pushed a commit to smiller171/vuetify that referenced this pull request Jun 18, 2018
when the local **tabs** changes, re-evaluate overflow

fixes vuetifyjs#3643
@lock
Copy link
Copy Markdown

lock bot commented Apr 15, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

T: bug Functionality that does not work as intended/expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] v-tabs not displaying arrows (pagination) when adding dynamically tabs

2 participants