fix(search): Handle touch events to prevent input blur on mobile when saving views (#1039)

On mobile devices, clicking "Save as Smart View" button caused the search
input to lose focus, triggering the onBlur handler that closes the entire
search menu. The existing onMouseDown preventDefault() only worked for
mouse events, not touch events on mobile.

Added onTouchStart handler alongside onMouseDown to properly prevent
input blur on mobile devices when interacting with the search menu.

Fixes #994
This commit is contained in:
Chris 2026-04-17 18:43:30 +03:00 committed by GitHub
parent 06527dc573
commit d32b5943d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -426,6 +426,10 @@ const SearchMenu: React.FC<SearchMenuProps> = ({
// Prevent input blur on mobile when clicking inside the search menu // Prevent input blur on mobile when clicking inside the search menu
e.preventDefault(); e.preventDefault();
}} }}
onTouchStart={(e) => {
// Prevent input blur on mobile when touching inside the search menu
e.preventDefault();
}}
> >
{/* Filter Badges Section */} {/* Filter Badges Section */}
<div className="border-b border-gray-200 dark:border-gray-700 overflow-y-auto max-h-[40vh] md:max-h-none"> <div className="border-b border-gray-200 dark:border-gray-700 overflow-y-auto max-h-[40vh] md:max-h-none">