Skip to content

Commit

Permalink
Merge pull request #9743 from Spaction/master
Browse files Browse the repository at this point in the history
Fixed #9742 - Implemented fix for #9660 prevents finding a value for simple array of options
  • Loading branch information
yigitfindikli committed Mar 15, 2021
2 parents d9efb83 + 864f7c4 commit e526215
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
}

getOptionValue(option: any) {
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel ? option : option.value);
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel || option.value === undefined ? option : option.value);
}

isOptionDisabled(option: any) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class Listbox implements AfterContentInit, ControlValueAccessor {
}

getOptionValue(option: any) {
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel ? option : option.value);
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel || option.value === undefined ? option : option.value);
}

isOptionDisabled(option: any) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export class MultiSelect implements OnInit,AfterViewInit,AfterContentInit,AfterV
}

getOptionValue(option: any) {
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel ? option : option.value);
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel || option.value === undefined ? option : option.value);
}

getOptionGroupLabel(optionGroup: any) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/selectbutton/selectbutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class SelectButton implements ControlValueAccessor {
}

getOptionValue(option: any) {
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel ? option : option.value);
return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel || option.value === undefined ? option : option.value);
}

isOptionDisabled(option: any) {
Expand Down

0 comments on commit e526215

Please sign in to comment.