darrenjennings / vue-autosuggest

πŸ” Vue autosuggest component.
https://darrenjennings.github.io/vue-autosuggest
MIT License
621 stars 91 forks source link

How to right clean input? #156

Closed Sendoo closed 4 years ago

Sendoo commented 4 years ago

What you did:

I want to create a method by which cleaning input (v-model) selectSection(data) { if (data) { this.currentSuggestValue = ' '; } }

What happened:

This code cleared input, but not rendering placeholder (empty).

Problem description:

How to right clean input?

darrenjennings commented 4 years ago

@Sendoo assuming you have v-model="currentSuggestionValue' then any reason you are not simply clearing it all the way? e.g.

- this.currentSuggestValue = ' '
+ this.currentSuggestValue = null
Sendoo commented 4 years ago

@Sendoo assuming you have v-model="currentSuggestionValue' then any reason you are not simply clearing it all the way? e.g.

- this.currentSuggestValue = ' '
+ this.currentSuggestValue = null

Since this is a text field, an error will be shown with null. ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅

Sendoo commented 4 years ago

I deleted props get-suggestion-value and the previous cleaning worked as it should!