Skip to content

Commit b07a5b2

Browse files
authored
Merge pull request #433 from apandichi/apandichi-patch-issue-283
Use capture mode with globalEventOff
2 parents 6973b83 + 37fad87 commit b07a5b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class ReactTooltip extends React.Component {
191191
* These listeners used to trigger showing or hiding the tooltip
192192
*/
193193
bindListener () {
194-
const {id, globalEventOff} = this.props
194+
const {id, globalEventOff, isCapture} = this.props
195195
let targetArray = this.getTargetArray(id)
196196

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

223223
// Track removal of targetArray elements from DOM

0 commit comments

Comments
 (0)