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(VCombobox): handle duplicates on chip edit #13794

Merged

Conversation

vibhash-singh
Copy link
Contributor

Description

Handle duplicate when a user tries to enter the already existing value in combobox on chip edit. Fixes #6364

Motivation and Context

Currently, when we edit a chip value and replace it with an already existing item, it will add that duplicate item. The fix is to make the behavior similar to the case where we try to add the duplicate item in the combobox. The duplicate value is not added but instead moved to the end of the list.

How Has This Been Tested?

Unit testing and Visually

Markup:

<template>
  <v-app id="inspire">
    <v-container>
      <v-combobox
        v-model="model"
        :items="items"
        label="Add some tags"
        multiple
        persistent-hint
        small-chips
      >
      </v-combobox>
    </v-container>
  </v-app>
</template>

<script>
  export default {
    data: () => ({
      model: ['A', 'B'],
      items: ['A', 'B'],
    }),
  }
  </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 features but makes 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 backwards compatible changes and next for non-backwards compatible 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)

@johnleider johnleider added C: VCombobox VCombobox T: bug Functionality that does not work as intended/expected labels Jun 17, 2021
@johnleider johnleider added this to the v2.5.x milestone Jun 17, 2021
@KaelWD KaelWD changed the title fix(VCombobox): handle duplicates on combobox chip edit fix(VCombobox): handle duplicates on chip edit Jul 19, 2021
@KaelWD KaelWD merged commit 7fac117 into vuetifyjs:master Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VCombobox VCombobox T: bug Functionality that does not work as intended/expected
Projects
None yet
3 participants