vue-select icon indicating copy to clipboard operation
vue-select copied to clipboard

Question: how to deselect or clear selection beta 3

Open soongsta opened this issue 3 years ago • 2 comments
trafficstars

  • Vue Version: nuxt3
  • Vue Select Version: vue-select 4.0.0-beta.3

Question How to deselect or clear selection in vue-select 4.0.0-beta.3

Reproduction Link https://stackblitz.com/edit/node-iquvk1?file=pages%2Findex.vue You may need to "npm run dev" in the console window

The reproduction link shows 2 ways where I am trying to call a method to clear the region field What is the proper way to do this? As both methods I have tried do not work

Cheers

soongsta avatar Mar 06 '22 06:03 soongsta

running into the same issue on my end. seems i cannot clear a selection

tkayo avatar Mar 14 '22 16:03 tkayo

I have the perfect example for this.

Using Vue-Select wrapped in a VueComponent, when the rest of the form values are reset to empty string values, Vue-Select will hold onto the selected value in model_value and _value. Setting the v-model to an empty { label: '', data: ''} will set a selection with an empty label string.

The consistent way I've been able to clear the selection is by setting your v-model to undefined using your stackblitz project.

Fork: https://stackblitz.com/edit/node-lkrt63?file=pages%2Findex.vue

OjGrooms avatar Jun 14 '22 14:06 OjGrooms

This issue persists on beta 5

ManuelTS avatar Nov 02 '22 10:11 ManuelTS

This is how I'd do it based on the original stackblitz example.

https://stackblitz.com/edit/node-ngtd7i?file=pages/index.vue

sagalbot avatar Nov 07 '22 22:11 sagalbot