Skip to content

Commit

Permalink
perf(dropdown): get option value judgment logic (primefaces#7083)
Browse files Browse the repository at this point in the history
* perf(dropdown): get option value judgment logic

* Update components/lib/dropdown/Dropdown.js

Co-authored-by: Melloware <[email protected]>

* Update components/lib/dropdown/Dropdown.js

* Update components/lib/dropdown/Dropdown.js

* Update components/lib/dropdown/Dropdown.js

* Update components/lib/dropdown/Dropdown.js

---------

Co-authored-by: Melloware <[email protected]>
  • Loading branch information
betavs and melloware authored Aug 24, 2024
1 parent 8b59787 commit d33b379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ export const Dropdown = React.memo(
const getOptionValue = (option) => {
const optionValue = props.optionValue ? ObjectUtils.resolveFieldData(option, props.optionValue) : option ? option['value'] : ObjectUtils.resolveFieldData(option, 'value');

return ObjectUtils.isNotEmpty(optionValue) ? optionValue : option;
return (props.optionValue || ObjectUtils.isNotEmpty(optionValue)) ? optionValue : option;
};

const getOptionRenderKey = (option) => {
Expand Down

0 comments on commit d33b379

Please sign in to comment.