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
2025-03-17 09:06:59 -07:00
committed by GitHub

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>
);
}}