NOTE: I'm not using v-autocomplete or v-combobox because they aren't able to do certain things that I want.
I'm having trouble implementing an autcomplete search bar. The search bar does everything as expected except for one minor thing, and that is being able to select an item. When I hover over an item, the pointer changes to a hand indicating that it's clickable. Once "clicked", a @click event is supposed to call a method, but nothing happens when an item is "clicked".
I know what the problem is, but I'm struggling to find a solution for it. The problem stems from these parts:
<v-text-field //this is the input
...
@focus="isFocused = true" @blur="isFocused = false"
...
></v-text-field>
<v-list v-show="queried_cards.length && isFocused"> //this is the list
<v-list-item @click="setCard(card)" v-for="(card, index) in queried_cards" :item="card" :key="index">
...
</v-list-item>
</v-list>
So, based on the above markup, I only want to show the list if the array queried_cards is not empty and if v-text-field is focused on. If I click out of the textfield then the list is hidden, which is the desired outcome that I want. It just so happens that it conflicts with the functionality of being able to select an item since when you click on an item, that is the same as clicking out of the textfield (triggers @blur). This results in the method setCard() not being called since v-list disappears before the event @click="setCard(card)" can happen.
I've been putting this on backlog for awhile thinking I'll eventually be able to find a solution, but I'm just burnt out from all the other stuff from this project.
I created a codepen that illustrate my problem: https://codepen.io/chataolauj/pen/RwwYxBg?editors=1010