Skip to content

Commit

Permalink
fix: remove tag when DoubleTag's label has empty children
Browse files Browse the repository at this point in the history
  • Loading branch information
agatha197 committed Nov 6, 2024
1 parent afacad0 commit 622b3db
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion react/src/components/DoubleTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ const DoubleTag: React.FC<{
return (
<Flex direction="row">
{_.map(objectValues, (objValue, idx) => {
return !_.isEmpty(objValue.label) ? (
const hasEmptyChildren =
React.isValidElement(objValue.label) &&
_.isEmpty((objValue.label as React.ReactElement)?.props?.children);

return hasEmptyChildren ? (
<></>
) : !_.isEmpty(objValue.label) ? (
<Tag
key={idx}
style={
Expand Down

0 comments on commit 622b3db

Please sign in to comment.