Fix search bar behaviour (step 4)

This commit is contained in:
Joshua Boniface 2025-03-02 14:35:07 -05:00
parent 99372fdfe8
commit c1ddbd1f3f

View File

@ -24,7 +24,7 @@
<button
v-if="modelValue && showList && showClearButton"
class="btn-clear"
@click="clearSearch"
@click.stop="clearSearch"
>
<i class="fas fa-times"></i>
</button>
@ -292,6 +292,14 @@ const clearSearch = () => {
emit('update:modelValue', '');
emit('clear');
// Focus the search input after clearing
nextTick(() => {
const searchInput = document.querySelector('.search-input');
if (searchInput) {
searchInput.focus();
}
});
};
// Select a VM