Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VTreeview): correcly handle updating items array of equal size #6202

Merged
merged 1 commit into from Jan 18, 2019

Conversation

nekosaur
Copy link
Member

Description

the VTreeview component did not handle updating items prop with an array
of equal size as current array.

Motivation and Context

fixes #6181

How Has This Been Tested?

unit tests and manual playground testing

Markup:

<template>
  <v-app id="inspire">
    <v-treeview
      v-model="tree"
      :open="open"
      :items="items"
      activatable
      item-key="name"
      item-children="children"
      open-on-click
    >
    </v-treeview>
    <v-btn  @click="reload">Test</v-btn>
    <v-btn @click="second">Second</v-btn>
    <v-btn @click="third">Third</v-btn>
  </v-app>
</template>

<script>
export default {
  data: () => ({
    open: ['public'],
    tree: [],
    items: [
      {
        name: 'one'
      },
      {
        name: 'two'
      }
    ]
  }),
  methods: {
    reload () {
      this.items = [
        {
          name: 'one'
        }
      ]
    },
    second () {
      this.items = [
        {
          name: 'one'
        },
        {
          name: 'three'
        }
      ]
    },
    third () {
      this.items = [
        {
          name: 'four'
        },
        {
          name: 'five'
        }
      ]
    }
  }
}
</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 and documentation updates, dev for new features and breaking changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

the VTreeview component did not handle updating items prop with an array
of equal size as current array.

fixes #6181
@vercel
Copy link

vercel bot commented Jan 18, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@codecov
Copy link

codecov bot commented Jan 18, 2019

Codecov Report

Merging #6202 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6202      +/-   ##
==========================================
+ Coverage   89.53%   89.54%   +<.01%     
==========================================
  Files         276      276              
  Lines        6318     6323       +5     
  Branches     1594     1594              
==========================================
+ Hits         5657     5662       +5     
  Misses        542      542              
  Partials      119      119
Impacted Files Coverage Δ
...ages/vuetify/src/components/VTreeview/VTreeview.ts 99.37% <100%> (ø) ⬆️
packages/vuetify/src/util/helpers.ts 91.12% <100%> (+0.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 70b99a4...d8a9eaf. Read the comment docs.

@johnleider johnleider merged commit 4177931 into master Jan 18, 2019
@johnleider johnleider deleted the fix/6181-treeview-new-list-same-size branch January 18, 2019 23:01
eubnara pushed a commit to eubnara/vuetify that referenced this pull request Jan 20, 2019
…uetifyjs#6202)

the VTreeview component did not handle updating items prop with an array
of equal size as current array.

fixes vuetifyjs#6181
@lock
Copy link

lock bot commented Apr 14, 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 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] Tree View component fails when replacing list with new list of same size
2 participants