From 8a99a0e7e4d7d47e633c44a12e6c517c44eb6e0c Mon Sep 17 00:00:00 2001 From: achernetsky Date: Sat, 29 Oct 2016 16:10:18 +0300 Subject: [PATCH] Use parameter 'useCapture' for remove listener if it is registered as a capturing --- src/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 15ebfe8ef..943799b7f 100644 --- a/src/index.js +++ b/src/index.js @@ -200,9 +200,10 @@ class ReactTooltip extends Component { * so that the tooltip can switch between custom and default listener */ unbindBasicListener (target) { - target.removeEventListener('mouseenter', this.showTooltip) - target.removeEventListener('mousemove', this.updateTooltip) - target.removeEventListener('mouseleave', this.hideTooltip) + const isCaptureMode = this.isCapture(target) + target.removeEventListener('mouseenter', this.showTooltip, isCaptureMode) + target.removeEventListener('mousemove', this.updateTooltip, isCaptureMode) + target.removeEventListener('mouseleave', this.hideTooltip, isCaptureMode) } /**