Fix search bar behaviour (step 8)
This commit is contained in:
parent
4a97f365b0
commit
804f049111
@ -262,6 +262,20 @@ const handleSearchClick = () => {
|
|||||||
const toggleList = () => {
|
const toggleList = () => {
|
||||||
// If the list is already open, toggle filtering instead of closing
|
// If the list is already open, toggle filtering instead of closing
|
||||||
if (props.showList) {
|
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
|
// Toggle filtering mode
|
||||||
isFilterActive.value = !isFilterActive.value;
|
isFilterActive.value = !isFilterActive.value;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user