[Library | Trunk]: Input on option filter return empty array for empty or null value

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60450 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-02-18 12:28:56 +00:00
parent f5d4a58b05
commit ce59d4e8bf
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ export class InputComponent implements OnInit, OnDestroy, OnChanges {
private filter(value: string): Option[] {
let options = this.options.filter(option => !this.formAsArray.value.find(value => option.value === value));
if (!value || value.length == 0) {
return options;
return [];
}
const filterValue = value.toString().toLowerCase();
return options.filter(option => option.label.toLowerCase().indexOf(filterValue) != -1);