Please respect maintainers time by filling in these sections. Your issue will likely be closed without this information.
Vue Version: 3.2.40
Vue Select Version: 4.0.0-beta.5
Describe the bug
A clear and concise description of what the bug is.
I'm using these two events on my v-select component:
@option:selecting="this.$emit('optionSelecting', $event)"
@option:deselecting="this.$emit('optionDeselecting', $event)"
Note that I am emiting because I'm using a wrapper component around v-select called "v-select-container".
In my parent component, I have these the v-select-container and two methods:
<v-select-container class="m-0"
:selected="data.carrier"
:visible="true"
ref="carrierInput"
data_uri="/api/carrier/paginated"
label_column="full_details"
@updated="$emit('updateSelectValue', $event, 'carrier.carrier', 'carrier_id')"
has_pagination
@optionSelecting="optionSelecting"
@optionDeselecting="optionDeselecting"
Note that V-select-container is basically just v-select.
The optionSelecting function is working as intended:
optionSelecting(option) {
console.log('hit optionSelecting');
// once a carrier is selected, set data.carrier_email and data.carrier_phone_number
this.data.carrier_email = option.email;
this.data.carrier_phone_number = option.phone_number;
},
However, this function is not running when I use the Deselect button and I can't figure out why. Is this a bug in the new 4.0 beta version ( Deselect button not emiting option:deselecting )
optionDeselecting(option) {
console.log('hit optionDeselecting');
// once a carrier is deselected, clear data.carrier_email and data.carrier_phone_number
this.data.carrier_email = '';
this.data.carrier_phone_number = '';
},
Reproduction Link
A link to a reproduction of the bug. This is a huge help.
Steps To Reproduce
Outline the steps to reproduce the bug.
Have a parent component that is importing v-select. The v-select should have this line of code:
@option:selecting="optionSelecting"
@option:deselecting="optionDeselecting"
When selecting an option, optionSelecting will fire off, but when you using the X button ( Deselect button ), the optionDeselecting function doesn't fire off. Shouldn't Deselect component fire off this event?
Expected behavior
A clear and concise description of what you expected to happen.
Describe the bug A clear and concise description of what the bug is.
I'm using these two events on my v-select component: @option:selecting="this.$emit('optionSelecting', $event)" @option:deselecting="this.$emit('optionDeselecting', $event)"
Note that I am emiting because I'm using a wrapper component around v-select called "v-select-container".
In my parent component, I have these the v-select-container and two methods: <v-select-container class="m-0" :selected="data.carrier" :visible="true" ref="carrierInput" data_uri="/api/carrier/paginated" label_column="full_details" @updated="$emit('updateSelectValue', $event, 'carrier.carrier', 'carrier_id')" has_pagination @optionSelecting="optionSelecting" @optionDeselecting="optionDeselecting"
Note that V-select-container is basically just v-select.
The optionSelecting function is working as intended: optionSelecting(option) { console.log('hit optionSelecting'); // once a carrier is selected, set data.carrier_email and data.carrier_phone_number this.data.carrier_email = option.email; this.data.carrier_phone_number = option.phone_number; },
However, this function is not running when I use the Deselect button and I can't figure out why. Is this a bug in the new 4.0 beta version ( Deselect button not emiting option:deselecting ) optionDeselecting(option) { console.log('hit optionDeselecting'); // once a carrier is deselected, clear data.carrier_email and data.carrier_phone_number this.data.carrier_email = ''; this.data.carrier_phone_number = ''; },
Reproduction Link A link to a reproduction of the bug. This is a huge help.
I tried creating a Jsfiddle, but I couldn't find the direct cdn url to include the 4.0 beta version. I tried: https://unpkg.com/vue-select@4.0.0/dist/vue-select.js
Steps To Reproduce Outline the steps to reproduce the bug.
Have a parent component that is importing v-select. The v-select should have this line of code: @option:selecting="optionSelecting" @option:deselecting="optionDeselecting"
When selecting an option, optionSelecting will fire off, but when you using the X button ( Deselect button ), the optionDeselecting function doesn't fire off. Shouldn't Deselect component fire off this event?
Expected behavior A clear and concise description of what you expected to happen.
Screenshots