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(VSelect): allow null values to be selected #4649

Merged
merged 4 commits into from Jul 20, 2018

Conversation

KaelWD
Copy link
Member

@KaelWD KaelWD commented Jul 18, 2018

Description

fixes #4431

Clearable still needs work, if you clear the select it'll revert to null and select the first item again.
No idea what those original checks were there for, it seems to work fine and tests still pass.
The internalValue === '' check was for #4032, but that's a separate component now and doesn't seem to have regressed.

Markup:

<template>
  <v-app>
    <v-container>
      <v-autocomplete
          v-model="selected"
          :items="items"
          label="Standard"
          clearable
      ></v-autocomplete>
      <pre>{{ JSON.stringify(selected) }}</pre>
    </v-container>
  </v-app>
</template>

<script>
  export default {
    data: () => ({
      selected: null,
      items: [
        { text: 'all of them', value: null },
        { text: 'fizz', value: 'Fizz' },
        { text: 'buzz', value: 'Buzz' },
        { text: 'foo', value: 'Foo' }
      ]
    })
  }
</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)

@codecov
Copy link

codecov bot commented Jul 18, 2018

Codecov Report

Merging #4649 into master will decrease coverage by 0.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4649      +/-   ##
==========================================
- Coverage   90.14%   89.98%   -0.16%     
==========================================
  Files         206      206              
  Lines        4919     4965      +46     
  Branches     1249     1274      +25     
==========================================
+ Hits         4434     4468      +34     
- Misses        388      394       +6     
- Partials       97      103       +6
Impacted Files Coverage Δ
src/components/VSelect/VSelect.js 95.21% <ø> (ø) ⬆️
src/components/VAutocomplete/VAutocomplete.js 98.19% <100%> (-0.04%) ⬇️
src/components/VFooter/VFooter.js 100% <0%> (ø) ⬆️
.../components/VNavigationDrawer/VNavigationDrawer.js 70.14% <0%> (+2.33%) ⬆️

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 098d07b...e66fbd4. Read the comment docs.

@KaelWD KaelWD requested a review from johnleider July 19, 2018 08:09
@johnleider johnleider merged commit 43a18b6 into master Jul 20, 2018
@KaelWD KaelWD deleted the fix/4431-autocomplete-null-items branch July 21, 2018 07:50
KaelWD added a commit that referenced this pull request Jul 23, 2018
@lock
Copy link

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] (v-autocomplete) not able to select an item that is a null value or an empty string
2 participants