Skip to content

Commit 37fad87

Browse files
authored
Use isCapture from props for globalEventOff
1 parent bacb815 commit 37fad87

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, isCaptureMode)
220+
window.addEventListener(globalEventOff, this.hideTooltip, isCapture)
221221
}
222222

223223
// Track removal of targetArray elements from DOM

0 commit comments

Comments
 (0)