From 9247a366ec3e5a5a8e77fc064e0144c6733de4a6 Mon Sep 17 00:00:00 2001 From: CodeElixir Date: Wed, 10 Apr 2024 18:45:41 +0530 Subject: [PATCH] AutoComplete: Use ObjectUtils helper class to check suggestion is object or not. --- components/lib/autocomplete/AutoCompletePanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/autocomplete/AutoCompletePanel.js b/components/lib/autocomplete/AutoCompletePanel.js index 20b58cb34e..958c65794e 100644 --- a/components/lib/autocomplete/AutoCompletePanel.js +++ b/components/lib/autocomplete/AutoCompletePanel.js @@ -149,7 +149,7 @@ export const AutoCompletePanel = React.memo( ); } - const key = `${index}_${typeof suggestion === 'object' ? getOptionRenderKey(suggestion) : suggestion}`; + const key = `${index}_${ObjectUtils.isObject(suggestion) ? getOptionRenderKey(suggestion) : suggestion}`; const itemProps = mergeProps( { style, @@ -168,7 +168,7 @@ export const AutoCompletePanel = React.memo( const flattenGroupedItems = (items) => { try { return items?.map((item) => [item?.[props?.optionGroupLabel], ...item?.[props?.optionGroupChildren]]).flat(); - } catch (e) {} + } catch (e) { } }; const createContent = () => {