Skip to content

Commit

Permalink
Merge pull request #1581 from FormidableLabs/bug/empty-voronoi-tooltips
Browse files Browse the repository at this point in the history
don't render empty flyouts
  • Loading branch information
boygirl authored May 18, 2020
2 parents 3c93c33 + aeccffb commit a3836c7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ export const voronoiContainerMixin = (base) =>
}
if (Array.isArray(activePoints) && activePoints.length) {
const labelProps = this.getLabelProps(props, activePoints);
return React.cloneElement(labelComponent, labelProps);
const { text } = labelProps;
const showLabel = Array.isArray(text) ? text.filter(Boolean).length : text;
return showLabel ? React.cloneElement(labelComponent, labelProps) : null;
} else {
return null;
}
Expand Down

0 comments on commit a3836c7

Please sign in to comment.