From 943b4549dc7b8c6788727a7ee3d5193f5a1200b1 Mon Sep 17 00:00:00 2001 From: Shubham Saurabh Date: Sat, 13 Apr 2024 18:04:14 +0530 Subject: [PATCH] Fix #6316: fixed issue on selecting option by key event when using optionValue prop (#6374) * Fix #6316: fixed issue on selecting option by key event when using optionValue prop * Update Dropdown.js --------- Co-authored-by: Shubham Saurabh Co-authored-by: Melloware --- components/lib/dropdown/Dropdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index be1ffa0fd1..14af03efde 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -863,11 +863,11 @@ export const Dropdown = React.memo( }; const getOptionLabel = (option) => { - return props.optionLabel ? ObjectUtils.resolveFieldData(option, props.optionLabel) : option && option.label !== undefined ? option.label : option; + return props.optionLabel ? ObjectUtils.resolveFieldData(option, props.optionLabel) : option; }; const getOptionValue = (option) => { - return props.optionValue ? ObjectUtils.resolveFieldData(option, props.optionValue) : option && option.value !== undefined ? option.value : option; + return props.optionValue ? ObjectUtils.resolveFieldData(option, props.optionValue) : option; }; const getOptionRenderKey = (option) => {