Merge pull request #1934 from Owaiseimdad/FIX-1913-Object-Existing-Check

Fixed the check for the label in options object in search component
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-03-17 09:06:59 -07:00
commit 71ab885d24
1 file changed
+3 -1
+3 -1
View File
@@ -154,6 +154,7 @@ const Search = ({
}}
renderOption={(props, option) => {
const { key, ...optionProps } = props;
const hasSecondaryLabel = secondaryLabel && option[secondaryLabel] !== undefined;
return (
<ListItem
key={key}
@@ -167,7 +168,8 @@ const Search = ({
: {}
}
>
{option[filteredBy] + (secondaryLabel ? ` (${option[secondaryLabel]})` : "")}
{option[filteredBy] +
(hasSecondaryLabel ? ` (${option[secondaryLabel]})` : "")}
</ListItem>
);
}}