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

Deselect deleted options #1778

Open wenxich opened 1 year ago

wenxich commented 1 year ago

Discussed in https://github.com/sagalbot/vue-select/discussions/1773

Originally posted by **wenxich** May 26, 2023 I have used v-select to create a dropdown of taggable items. I have connected the options in this dropdown to an array I can manually edit/delete items from. However, if an option is selected in the dropdown, then when I go to delete this option from the array, this option is still selected. For example, say that my dropdown has items 'option 1', 'option 2', and 'option 3'. My dropdown currently has 'option 3' selected. However, when I delete 'option 3' from the array manually, while the dropdown menu no longer has 'option 3' as an item, my dropdown still has 'option 3' selected. Has anyone else run into this? If so, how can I make sure my dropdown deselects an option if it's been deleted?