I am facing an issue with my autocomplete form. It works perfectly fine locally, but once compiled to a PWA, the data filtering feature stops functioning properly. The API is returning a JSON array response as expected.
var modify = function (term) {
var result = "";
for (var i = 0; i < term.length; i++) {
result += accentMap[term.charAt(i)] || term.charAt(i);
}
return result;
};
search(Objobs: { Objjobs?: any; id?: any; }, filter: { name: string } = { name: '' }, page = 1): Observable<IUserResponse> {
return this.http.get<IUserResponse>('https://example.com/api/data/123' ).pipe(
tap((response: IUserResponse) => {
response.results = response.results
// Issue occurs on mobile devices (Android, iOS) where filtering doesn't work!
.map(user => new User(user.id_city, user.city_name))
.filter(user => modify(user.city_name.toLowerCase()).includes(filter.name))
return response;
//console.log(response);
})
)
}