Skip to content

Commit

Permalink
Merge pull request #433 from apandichi/apandichi-patch-issue-283
Browse files Browse the repository at this point in the history
Use capture mode with globalEventOff
  • Loading branch information
aronhelser authored Sep 20, 2018
2 parents 6973b83 + 37fad87 commit b07a5b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class ReactTooltip extends React.Component {
* These listeners used to trigger showing or hiding the tooltip
*/
bindListener () {
const {id, globalEventOff} = this.props
const {id, globalEventOff, isCapture} = this.props
let targetArray = this.getTargetArray(id)

targetArray.forEach(target => {
Expand All @@ -217,7 +217,7 @@ class ReactTooltip extends React.Component {
// Global event to hide tooltip
if (globalEventOff) {
window.removeEventListener(globalEventOff, this.hideTooltip)
window.addEventListener(globalEventOff, this.hideTooltip, false)
window.addEventListener(globalEventOff, this.hideTooltip, isCapture)
}

// Track removal of targetArray elements from DOM
Expand Down

0 comments on commit b07a5b2

Please sign in to comment.