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:
1 file changed
+3
-1
@@ -154,6 +154,7 @@ const Search = ({
|
|||||||
}}
|
}}
|
||||||
renderOption={(props, option) => {
|
renderOption={(props, option) => {
|
||||||
const { key, ...optionProps } = props;
|
const { key, ...optionProps } = props;
|
||||||
|
const hasSecondaryLabel = secondaryLabel && option[secondaryLabel] !== undefined;
|
||||||
return (
|
return (
|
||||||
<ListItem
|
<ListItem
|
||||||
key={key}
|
key={key}
|
||||||
@@ -167,7 +168,8 @@ const Search = ({
|
|||||||
: {}
|
: {}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{option[filteredBy] + (secondaryLabel ? ` (${option[secondaryLabel]})` : "")}
|
{option[filteredBy] +
|
||||||
|
(hasSecondaryLabel ? ` (${option[secondaryLabel]})` : "")}
|
||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in new issue
Block a user