From c6407570c7a45cd01d2ea1da394ff78ce8bb5ecd Mon Sep 17 00:00:00 2001 From: Chris Veleris Date: Thu, 23 Oct 2025 21:42:59 +0300 Subject: [PATCH] Fix search collapse on mobile --- .../components/UniversalSearch/SearchMenu.tsx | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/frontend/components/UniversalSearch/SearchMenu.tsx b/frontend/components/UniversalSearch/SearchMenu.tsx index 7cec5b0..d50f2c9 100644 --- a/frontend/components/UniversalSearch/SearchMenu.tsx +++ b/frontend/components/UniversalSearch/SearchMenu.tsx @@ -170,7 +170,11 @@ const SearchMenu: React.FC = ({ const entitiesWithSeparators: React.ReactNode[] = []; entities.forEach((entity, index) => { if (index > 0) { - entitiesWithSeparators.push(' ' + t('search.and') + ' '); + entitiesWithSeparators.push( + + {' ' + t('search.and') + ' '} + + ); } entitiesWithSeparators.push(entity); }); @@ -189,7 +193,11 @@ const SearchMenu: React.FC = ({ // Add search query if (searchQuery.trim()) { - parts.push(t('search.containingText') + ' '); + parts.push( + + {t('search.containingText') + ' '} + + ); parts.push( = ({ // Add priority filter if (selectedPriority) { - parts.push(t('search.withPriority') + ' '); + parts.push( + + {t('search.withPriority') + ' '} + + ); parts.push( = ({ {selectedPriority} ); - parts.push(' ' + t('search.priority')); + parts.push( + {' ' + t('search.priority')} + ); } // Add due date filter @@ -220,7 +234,7 @@ const SearchMenu: React.FC = ({ (opt) => opt.value === selectedDue ); const dueLabel = dueOption ? t(dueOption.labelKey) : selectedDue; - parts.push(t('search.due') + ' '); + parts.push({t('search.due') + ' '}); parts.push( = ({ // Add tags filter if (selectedTags.length > 0) { - parts.push(t('search.taggedWith') + ' '); + parts.push( + {t('search.taggedWith') + ' '} + ); const tagElements = selectedTags.map((tag) => ( = ({ tagElements.forEach((tagEl, index) => { if (index > 0) { if (index === tagElements.length - 1) { - tagsWithSeparators.push(' ' + t('search.and') + ' '); + tagsWithSeparators.push( + + {' ' + t('search.and') + ' '} + + ); } else { - tagsWithSeparators.push(', '); + tagsWithSeparators.push( + {', '} + ); } } tagsWithSeparators.push(tagEl); @@ -275,7 +297,13 @@ const SearchMenu: React.FC = ({ selectedTags.length > 0; return ( -
+
{ + // Prevent input blur on mobile when clicking inside the search menu + e.preventDefault(); + }} + > {/* Filter Badges Section */}
{/* Search Description */}