sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.63k stars 1.34k forks source link

Vue 3 / simple array of strings #1770

Open mo-rocks opened 1 year ago

mo-rocks commented 1 year ago

Describe the bug Trying to pass a simple array of strings into options throws error

Edit: I noticed that every other time, it works - on the first select of an option, the error appears and the dropdown closes. THe second time, it selects the option properly. After that, it works fine every time, until I clear the selection. When the selection is cleared, the first time I select an option, the same thing happens - the "getOptionKey" function detects the incoming option as an object - it should just be a string. Possible issue related to "typeof null" being an object.

Steps To Reproduce Basic code:

<v-select :options="['Manager', 'Supervisor']" />

Trying to select an option gives error in devtools: could not stringify this option:

image

Expected behavior Simply select 1 of two options without needing to make it an array of objects