charliekassel / vuejs-autocomplete

Autocomplete component for Vue js
MIT License
135 stars 78 forks source link

Cannot set initial value after clearing #89

Open NoelDavies opened 4 years ago

NoelDavies commented 4 years ago

I set an initial value like so


                  <autocomplete
                    ref="autocomplete"
                    :source="autoCompleteItems"
                    results-value="value"
                    results-display="text"
                    class="speciesname_autocomplete"
                    input-class="bg-white text-black border border-gray-400 hover:border-gray-500 p-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline focus:bg-gray-200"
                    @selected="setSpecies"
                    :initial-value="species"
                    :initial-display="speciesName"
                  >
                  </autocomplete>

I see in dev tools that it's set, but it doesn't set any value internally.

I've also tried using refs to change internal component data but to no avail.