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.62k stars 1.33k forks source link

@input event do not work #1619

Closed SchmidtDawid closed 2 years ago

SchmidtDawid commented 2 years ago

Describe the bug input event does not fire after option is selected

<v-select
  v-model="device.configuration.deviceConfig.actionConfigSource"
  :options="fileList"
  :reduce="(option) => option.value"
  @input="onFileChange"
/>
nowaysgit commented 2 years ago

You can try @option:selected="onFileChange" fuction onFileChange(val) {}

mkalantar commented 2 years ago

read here #1597

value renamed to modelValue to match the Vue 3 v-model syntax
@input event renamed to update:modelValue
sagalbot commented 2 years ago

Thanks for providing that info @mkalantar!

LizAinslie commented 2 years ago

It'd be really nice to have this documented somewhere. I struggled for two hours thinking this was an issue with my own code and then I found this issue and after renaming the event & prop, everything works. I'm sure this isn't the first time this has happened either, given this issue was opened on April 2nd; It'd be nice to not have such headaches :)

coleman-benjamin commented 1 year ago

Bumping this thread, having this documented would also have saved me a couple of hours of headache!

LizAinslie commented 1 year ago

Been a few months, so I'm bumping this again since it's fresh, though only to save others' headaches. Since I've already implemented my own solution, it's not of much use to me personally. However, I can imagine having documentation of such an unusual deviation from the norm would surely benefit countless others

miksony commented 1 year ago

I was able to find solution with using


<v-select
:options="options"
:model-value="value"
@option:selected="(selected) => { value = selected; }"
>
</v-select>
marbled-ky-pnt commented 1 year ago

I was able to find solution with using


<v-select
:options="options"
:model-value="value"
@option:selected="(selected) => { value = selected; }"
>
</v-select>

It's working for Vue3 . thanks so much !!

Crovitche-1623 commented 2 months ago

This change should be also changed in the documentation https://vue-select.org/api/events.html#input.

adamreisnz commented 2 weeks ago

Can't believe this still hasn't been updated in the docs two years later? It's a pretty critical breaking change going from Vue 2 to Vue 3.