From e0e2cec386464de1f210efc39b727733326ddc1f Mon Sep 17 00:00:00 2001 From: Owaise Imdad Date: Sat, 15 Mar 2025 22:31:15 +0530 Subject: [PATCH] Moved the evaluation in start of the render option execution. --- src/Components/Inputs/Search/index.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Components/Inputs/Search/index.jsx b/src/Components/Inputs/Search/index.jsx index 9e08a0dc2..a3b75161c 100644 --- a/src/Components/Inputs/Search/index.jsx +++ b/src/Components/Inputs/Search/index.jsx @@ -154,6 +154,7 @@ const Search = ({ }} renderOption={(props, option) => { const { key, ...optionProps } = props; + const hasSecondaryLabel = secondaryLabel && option[secondaryLabel] !== undefined; return ( {option[filteredBy] + - (secondaryLabel && option[secondaryLabel] - ? ` (${option[secondaryLabel]})` - : "")} + (hasSecondaryLabel ? ` (${option[secondaryLabel]})` : "")} ); }}