mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
SearchMixin: Limit number of JSON search results
This commit is contained in:
parent
027ad398d6
commit
6b183db6e0
@ -1201,8 +1201,14 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(superclass
|
||||
{
|
||||
return option.label.toLowerCase().includes(lower_search) || option.value.includes(search)
|
||||
});
|
||||
// Limit results
|
||||
const totalCount = filtered.length;
|
||||
if(filtered.length > Et2WidgetWithSearch.RESULT_LIMIT)
|
||||
{
|
||||
filtered.splice(Et2WidgetWithSearch.RESULT_LIMIT);
|
||||
}
|
||||
// Add the matches
|
||||
this.processRemoteResults(filtered);
|
||||
this.processRemoteResults(filtered, totalCount);
|
||||
return filtered;
|
||||
})
|
||||
.catch((_err) =>
|
||||
|
Loading…
Reference in New Issue
Block a user