[frontend]: Ignore non-alphanumeric characters in search
This commit is contained in:
@ -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]);
|
||||
|
||||
|
Reference in New Issue
Block a user