[frontend]: Ignore non-alphanumeric characters in search

This commit is contained in:
2025-04-01 00:40:36 +01:00
parent b3befc2ba3
commit 718aa6905a

View File

@ -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]);