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(VAutocomplete): Update dynamically when itemText is updated #6431

Merged
merged 3 commits into from
Feb 10, 2019

Conversation

heidricklevi
Copy link
Contributor

Closes #6368

Description

Motivation and Context

Addresses #6368

How Has This Been Tested?

visually

Markup:

// Paste your FULL Playground.vue here
<template>
<boilerplate>
 <v-card>
      <v-card-title class="headline font-weight-regular blue-grey white--text">Profile</v-card-title>
      <v-card-text>
        <v-subheader v-if="model" class="pa-0">
          Lang: {{ lang }},
          Model: {{ model }}, <br /><br />
          Items: {{ myItems }}
        </v-subheader>
        <v-select
          :items="langs"
          label="Parameter currentLang" v-model="lang"
        ></v-select>
        <v-autocomplete
          v-model="model"
          :items="myItems" :item-text="displayLabel"
          label="Autocomplete with translation"
          persistent-hint solo return-object
          prepend-icon="mdi-flag"
        >
        </v-autocomplete>
      </v-card-text>
    </v-card>
    </boilerplate>
</template>

<script>
  import Boilerplate from './Boilerplate'
  export default {
    components: {
      Boilerplate,
    },
    computed: {
     displayLabel() {
        return 'labels.' + this.lang
      }
    },
    data () {
      return {
        model: null,
        lang: null,
        myItems: [
          {
            id: 1,
            labels: { "1033": "ID 1 English", "1036": "ID 1 French" }
          },
          {
            id: 2,
            labels: { "1033": "ID 2 English", "1036": "ID 2 French" }
          },
        ],
        langs: [ 1033, 1036 ]
      }
    },
  }
</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)

@codecov
Copy link

codecov bot commented Feb 9, 2019

Codecov Report

Merging #6431 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6431      +/-   ##
==========================================
+ Coverage   84.56%   84.59%   +0.03%     
==========================================
  Files         297      297              
  Lines        7120     7121       +1     
  Branches     1764     1764              
==========================================
+ Hits         6021     6024       +3     
+ Misses       1014     1013       -1     
+ Partials       85       84       -1
Impacted Files Coverage Δ
...tify/src/components/VAutocomplete/VAutocomplete.js 100% <100%> (+1.8%) ⬆️

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 cbf5329...caa8e27. Read the comment docs.

@jacekkarczmarczyk
Copy link
Member

Can you also add unit tests for this?

@heidricklevi
Copy link
Contributor Author

@jacekkarczmarczyk Yes, I will go ahead and do that

Copy link
Contributor

@dsseng dsseng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add unit tests for this, otherwise LGTM

@vercel vercel bot temporarily deployed to staging February 10, 2019 18:28 Inactive
@heidricklevi
Copy link
Contributor Author

I updated the PR and added in the necessary unit tests.

@jacekkarczmarczyk jacekkarczmarczyk added T: bug Functionality that does not work as intended/expected and removed S: work in progress S: needs unit tests This PR needs unit tests labels Feb 10, 2019
@jacekkarczmarczyk jacekkarczmarczyk added this to the 1.5.x milestone Feb 10, 2019
@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
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-select item-text doesn't update dynamically
4 participants