shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.65k stars 989 forks source link

Vue3 /next: reset-after does not work, no way to clear values. #1760

Closed rmakings closed 3 months ago

rmakings commented 3 months ago

When re-using the component, after selection the component should be able to be cleared. i.e set the modelValue to null or equivalent.

Steps to reproduce

            <vMultiSelect 
                v-model="value"
                :options="tzLookup"
                :close-on-select="true"
                :reset-after="true"
                placeholder="Location"
                label="icao_code"
                track-by="icao_code"
                @select="addNewTz"
            />

Expected behaviour

The MultiSelect is hidden in an overlay panel and is opened and used to select an option set to add additional widgets to the DOM. Once an option is selected, both the select and panel close. Upon reopening the overlay, the select should be reset to default state.

Actual behaviour

The select does not reset. I cannot find a way to set the initial value back to null or equivalent. The previously selected option remains selected.

rmakings commented 3 months ago

Closing this as not assigning the v-model to anything produces the desired result for this use case.