Skip to content

Commit

Permalink
fix(TooltipSimple): handle case when the tooltip icon not displaying (c…
Browse files Browse the repository at this point in the history
…arbon-design-system#793)

* fix(TooltipSimple): handle case when the tooltip icon not displaying, resolves carbon-design-system#786

* fix(TooltipSimple): handle case when the tooltip icon not displaying, resolves carbon-design-system#786
  • Loading branch information
rezak-otmani authored and marijohannessen committed Apr 10, 2018
1 parent 6da6698 commit c55e5a3
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions src/components/TooltipSimple/TooltipSimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,31 @@ const TooltipSimple = ({

const tooltipWrapperClasses = classNames(`bx--tooltip--simple`, className);
return (
<div className={tooltipWrapperClasses}>
{children}
<div
className={tooltipClasses}
data-tooltip-text={text}
tabIndex="0"
role="button"
{...other}>
{showIcon && (
<Icon role="img" name={iconName} description={iconDescription} />
)}
</div>
<div>
{showIcon ? (
<div className={tooltipWrapperClasses}>
{children}
<div
className={tooltipClasses}
data-tooltip-text={text}
tabIndex="0"
role="button"
{...other}>
<Icon role="img" name={iconName} description={iconDescription} />
</div>
</div>
) : (
<div className={tooltipWrapperClasses}>
<div
className={tooltipClasses}
data-tooltip-text={text}
tabIndex="0"
role="button"
{...other}>
{children}
</div>
</div>
)}
</div>
);
};
Expand Down

0 comments on commit c55e5a3

Please sign in to comment.