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): don't reset value to null if search is empty #12415

Merged
merged 1 commit into from Nov 17, 2020

Conversation

KaelWD
Copy link
Member

@KaelWD KaelWD commented Oct 15, 2020

Description

fixes #12322

I can't think of a good reason to count '' as clean, search is reset to null on blur anyway so it can only mean:

  • value is '' and nothing was changed, or
  • value is set and search was deleted by the user

Only checked with combobox, probably doesn't break autocomplete though.

Markup:

<template>
  <v-container>
    <pre>{{ JSON.stringify(String(select)) }}</pre>
    <pre>{{ JSON.stringify(String(search)) }}</pre>
    <v-combobox v-model="select" :search-input.sync="search"></v-combobox>
    <v-btn @click="select = ''">reset</v-btn>
    <v-btn @click="search = ''">reset search</v-btn>
  </v-container>
</template>

<script>
  export default {
    data: () => ({
      select: '',
      search: '',
    }),
  }
</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)

@MajesticPotatoe MajesticPotatoe added C: VCombobox VCombobox T: bug Functionality that does not work as intended/expected labels Nov 10, 2020
Copy link
Member

@MajesticPotatoe MajesticPotatoe left a comment

Choose a reason for hiding this comment

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

LGTM

@MajesticPotatoe MajesticPotatoe merged commit f1b621b into master Nov 17, 2020
@MajesticPotatoe MajesticPotatoe deleted the fix/12322-combobox-dirty-empty-string branch November 17, 2020 15:17
@johnleider johnleider added this to the v2.3.x milestone Nov 17, 2020
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