Skip to content

Commit

Permalink
🎨 Don't show tooltip if title is empty (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomfrida authored Nov 26, 2020
1 parent ce99fd4 commit 237d09a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions libraries/core-react/src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,7 @@ export type TooltipProps = {
// Controller for TooltipItem
export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
function Tooltip(
{
className,
title = '',
children,
placement = 'bottom',
open = false,
...rest
},
{ className, title, children, placement = 'bottom', open = false, ...rest },
ref,
) {
const [openState, setOpenState] = useState(open)
Expand Down Expand Up @@ -160,7 +153,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
>
{children}
</div>
{openState && (
{openState && title !== '' && (
<StyledTooltipWrapper
style={{ justifySelf: 'center' }}
role="tooltip"
Expand Down

0 comments on commit 237d09a

Please sign in to comment.