Fix search bar behaviour (step 8)

This commit is contained in:
Joshua Boniface 2025-03-02 14:46:05 -05:00
parent 4a97f365b0
commit 804f049111

View File

@ -262,6 +262,20 @@ const handleSearchClick = () => {
const toggleList = () => {
// If the list is already open, toggle filtering instead of closing
if (props.showList) {
// If we're in list mode (not filtering) and the button is clicked, close the drawer
if (!isFilterActive.value) {
// Save the current search text before closing
if (props.modelValue) {
searchText.value = props.modelValue;
// Save to localStorage
localStorage.setItem('vmSearchText', props.modelValue);
}
// Close the drawer
emit('toggle-list');
return;
}
// Toggle filtering mode
isFilterActive.value = !isFilterActive.value;