I recently implemented a search input form in my VueJS 2 application, allowing users to search for a location and view a list of nearby pharmacies on the page. However, I encountered an issue with the autocomplete feature not working properly. An error message stating "Can not read property 'find' of undefined" is being displayed. The relevant code snippet is provided below:
<input
id="District"
name="District"
class="form-control"
data-live-search="true"
list="places-list"
v-model="searchString"
@input="handleAutocomplete($event.target.value)"
/>
<datalist id="places-list">
<option
v-for="place in placesList"
:value="place['description']"
label=""
:key="place['place_id']"
>
<!-- {{ place.name }} -->
</option>
</datalist>
<!-- The rest of the component's code goes here... -->
If anyone has encountered this error before and knows how to resolve it, your assistance would be greatly appreciated. Thank you!