Skip to content

Commit

Permalink
fix(tooltip): fix tooltip offset with scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte committed Sep 5, 2017
1 parent 675c668 commit c320c23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/charts/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export default class Container extends Component {
}

showTooltip = (content, event) => {
const { pageX, pageY } = event
const { clientX, clientY } = event
const bounds = this.container.getBoundingClientRect()

this.setState({
isTooltipVisible: true,
tooltipContent: content,
tooltipX: pageX - bounds.left + 20,
tooltipY: pageY - bounds.top,
tooltipX: clientX - bounds.left + 20,
tooltipY: clientY - bounds.top,
})
}

Expand Down

0 comments on commit c320c23

Please sign in to comment.