Skip to content

Commit

Permalink
fix(VAutocomplete): return all filtered items, ensure itemText is pre…
Browse files Browse the repository at this point in the history
…sent

fixes #11451

related to #11415, #11442, and f8068ed
  • Loading branch information
johnleider committed Jun 3, 2020
1 parent 238f361 commit 6432fb4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/vuetify/src/components/VAutocomplete/VAutocomplete.ts
Expand Up @@ -7,7 +7,11 @@ import VTextField from '../VTextField/VTextField'

// Utilities
import mergeData from '../../util/mergeData'
import { keyCodes, getObjectValueByPath } from '../../util/helpers'
import {
getObjectValueByPath,
getPropertyFromItem,
keyCodes,
} from '../../util/helpers'

// Types
import { PropType } from 'vue'
Expand Down Expand Up @@ -84,15 +88,10 @@ export default VSelect.extend({
if (!this.isSearching || this.noFilter || this.internalSearch == null) return this.allItems

return this.allItems.filter(item => {
const text = this.getText(item)
const value = getPropertyFromItem(item, this.itemText, undefined)
const text = value != null ? String(value) : ''

// Remove items without text to match
if (
text == null ||
typeof text === 'object'
) return false

return this.filter(item, String(this.internalSearch), String(text))
return this.filter(item, String(this.internalSearch), text)
})
},
internalSearch: {
Expand Down

0 comments on commit 6432fb4

Please sign in to comment.