Selaa lähdekoodia

only suggest cities starting with query

Abhinav 1 vuosi sitten
vanhempi
commit
759d973b3a
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      apps/photos/src/services/locationSearchService.ts

+ 1 - 1
apps/photos/src/services/locationSearchService.ts

@@ -33,7 +33,7 @@ class LocationSearchService {
         }
         await this.citiesPromise;
         return this.cities.filter((city) => {
-            return city.city.toLowerCase().includes(searchTerm.toLowerCase());
+            return city.city.toLowerCase().startsWith(searchTerm.toLowerCase());
         });
     }
 }