Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(tooltip): remove tag prop so anchor is always a span
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric committed Mar 25, 2020
1 parent 3b5aeca commit 0c4a72a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Tooltip.js
Expand Up @@ -65,7 +65,6 @@ class Tooltip extends Component {
const {
children,
className,
tag: Element,
content,
dataTest,
maxWidth,
Expand All @@ -82,14 +81,14 @@ class Tooltip extends Component {
ref: this.ref,
})
) : (
<Element
<span
onMouseOver={this.onMouseOver}
onMouseOut={this.onMouseOut}
ref={this.ref}
data-test={`${dataTest}-reference`}
>
{children}
</Element>
</span>
)}

{open &&
Expand Down Expand Up @@ -144,7 +143,6 @@ Tooltip.defaultProps = {
* @prop {string} [dataTest=dhis2-uicore-tooltip]
* @prop {number} [maxWidth=300]
* @prop {('top'|'bottom'|'right'|'left')} [placement=top]
* @prop {string} [tag=span] The HTML tag to render
*/
Tooltip.propTypes = {
children: propTypes.node,
Expand All @@ -153,7 +151,6 @@ Tooltip.propTypes = {
dataTest: propTypes.string,
maxWidth: propTypes.number,
placement: propTypes.oneOf(['top', 'right', 'bottom', 'left']),
tag: propTypes.string,
}

export { Tooltip, TOOLTIP_OFFSET }

0 comments on commit 0c4a72a

Please sign in to comment.