From 718aa6905a91d7e6790bc03e149cffd3298c1658 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 1 Apr 2025 00:40:36 +0100 Subject: [PATCH] [frontend]: Ignore non-alphanumeric characters in search --- frontend/src/App.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 09f6160..a6db786 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -390,7 +390,7 @@ function App() { coords: [item.latitude, item.longitude], popup: popupContent, icon: icon, - markerText: markerText.toLowerCase(), + markerText: markerText.toLowerCase().replace(/[^a-zA-Z0-9]/g, ''), display: true }); } @@ -408,7 +408,7 @@ function App() { const memoizedFilteredMarkers = useMemo(() => { return markers.filter(marker => - marker.markerText.includes(searchTerm.toLowerCase()) + marker.markerText.includes(searchTerm.toLowerCase().replace(/[^a-zA-Z0-9]/g, '')) ); }, [searchTerm, markers]);