Skip to content

[Bug Report][2.5.6] Error with a function as item-text in v-autocomplete with multiselection #13877

@adamsol

Description

@adamsol

Environment

Vuetify Version: 2.5.6
Vue Version: 2.6.13
Browsers: Chrome 91.0.4472.114
OS: Windows 10

Steps to reproduce

Click the field and click outside to unfocus it. Open the console to observe an error.

Expected Behavior

No error.

Actual Behavior

TypeError: item.getText is not a function
    at item-text (eval at createFunction (vue.js:1), <anonymous>:3:130)
    at getPropertyFromItem (helpers.ts:140)
    at VueComponent.getText (VSelect.ts:586)
    at VueComponent.getValue (VSelect.ts:589)
    at VueComponent.updateSelf (VAutocomplete.ts:419)
    at VueComponent.isFocused (VAutocomplete.ts:177)

Reproduction Link

https://codepen.io/adamsol1/pen/zYwGPYM?editors=1010

Other comments

Such an approach was suggested in #8912 to circumvent the lack of direct handling of item functions. The error is thrown because the function is called on an array instead of a single item.

Metadata

Metadata

Assignees

Labels

C: VAutocompleteT: bugFunctionality that does not work as intended/expected

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions