Fixed #4681 - Add empty option check to some components

pull/4683/head
mertsincan 2023-10-24 14:06:14 +01:00
parent 0d1beb2f1c
commit f959976b70
5 changed files with 5 additions and 5 deletions

View File

@ -765,7 +765,7 @@ export default {
return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.searchLocale) === value.toLocaleLowerCase(this.searchLocale);
},
isValidOption(option) {
return option && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
return ObjectUtils.isNotEmpty(option) && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
},
isValidSelectedOption(option) {
return this.isValidOption(option) && this.isSelected(option);

View File

@ -528,7 +528,7 @@ export default {
return this.isValidOption(processedOption) && this.getProccessedOptionLabel(processedOption).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale));
},
isValidOption(processedOption) {
return !!processedOption && !this.isOptionDisabled(processedOption.option);
return ObjectUtils.isNotEmpty(processedOption) && !this.isOptionDisabled(processedOption.option);
},
isValidSelectedOption(processedOption) {
return this.isValidOption(processedOption) && this.isSelected(processedOption);

View File

@ -711,7 +711,7 @@ export default {
return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
},
isValidOption(option) {
return option && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
return ObjectUtils.isNotEmpty(option) && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
},
isValidSelectedOption(option) {
return this.isValidOption(option) && this.isSelected(option);

View File

@ -511,7 +511,7 @@ export default {
return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
},
isValidOption(option) {
return option && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
return ObjectUtils.isNotEmpty(option) && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
},
isValidSelectedOption(option) {
return this.isValidOption(option) && this.isSelected(option);

View File

@ -804,7 +804,7 @@ export default {
return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
},
isValidOption(option) {
return option && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
return ObjectUtils.isNotEmpty(option) && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
},
isValidSelectedOption(option) {
return this.isValidOption(option) && this.isSelected(option);