From d33b379ac3fca491dc010e7677f3943799e117fd Mon Sep 17 00:00:00 2001 From: betavs <34408516+betavs@users.noreply.github.com> Date: Sat, 24 Aug 2024 19:35:42 +0800 Subject: [PATCH] perf(dropdown): get option value judgment logic (#7083) * perf(dropdown): get option value judgment logic * Update components/lib/dropdown/Dropdown.js Co-authored-by: Melloware * 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 --- components/lib/dropdown/Dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index d1140816fb..9b161ccdb8 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -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) => {