Skip to content

Commit

Permalink
fix(TooltipDefinition): render span in component (#8910)
Browse files Browse the repository at this point in the history
* fix(TooltipDefinition): render `span` in component

* chore: update snapshots

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
emyarod and kodiakhq[bot] authored Jun 15, 2021
1 parent 7b9350a commit cb6de30
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const TooltipDefinition = ({
}, []);

return (
<div
<span
{...rest}
className={tooltipClassName}
onMouseEnter={composeEventHandlers([onMouseEnter, handleMouseEnter])}
Expand All @@ -93,13 +93,13 @@ const TooltipDefinition = ({
onBlur={composeEventHandlers([onBlur, handleBlur])}>
{children}
</button>
<div
<span
className={`${prefix}--assistive-text`}
id={tooltipId}
role="tooltip">
{tooltipText}
</div>
</div>
</span>
</span>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`TooltipDefinition should allow the user to specify the direction 1`] =
direction="top"
tooltipText="tooltip text"
>
<div
<span
className="bx--tooltip--definition bx--tooltip--a11y custom-class"
onMouseEnter={[Function]}
onMouseLeave={[Function]}
Expand All @@ -21,14 +21,14 @@ exports[`TooltipDefinition should allow the user to specify the direction 1`] =
>
tooltip trigger
</button>
<div
<span
className="bx--assistive-text"
id="definition-tooltip-3"
role="tooltip"
>
tooltip text
</div>
</div>
</span>
</span>
</TooltipDefinition>
`;

Expand All @@ -39,7 +39,7 @@ exports[`TooltipDefinition should render 1`] = `
direction="bottom"
tooltipText="tooltip text"
>
<div
<span
className="bx--tooltip--definition bx--tooltip--a11y custom-class"
onMouseEnter={[Function]}
onMouseLeave={[Function]}
Expand All @@ -53,14 +53,14 @@ exports[`TooltipDefinition should render 1`] = `
>
tooltip trigger
</button>
<div
<span
className="bx--assistive-text"
id="definition-tooltip-1"
role="tooltip"
>
tooltip text
</div>
</div>
</span>
</span>
</TooltipDefinition>
`;

Expand All @@ -72,7 +72,7 @@ exports[`TooltipDefinition should support a custom trigger element class 1`] = `
tooltipText="tooltip text"
triggerClassName="custom-trigger-class"
>
<div
<span
className="bx--tooltip--definition bx--tooltip--a11y custom-class"
onMouseEnter={[Function]}
onMouseLeave={[Function]}
Expand All @@ -86,13 +86,13 @@ exports[`TooltipDefinition should support a custom trigger element class 1`] = `
>
tooltip trigger
</button>
<div
<span
className="bx--assistive-text"
id="definition-tooltip-2"
role="tooltip"
>
tooltip text
</div>
</div>
</span>
</span>
</TooltipDefinition>
`;

0 comments on commit cb6de30

Please sign in to comment.