Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class ReactTooltip extends React.Component {
this.clearTimer();

this.unbindListener();
this.removeScrollListener();
this.removeScrollListener(this.state.currentTarget);
this.unbindWindowEvents();
}

Expand Down Expand Up @@ -573,7 +573,7 @@ class ReactTooltip extends React.Component {
this.removeListenerForTooltipExit();

this.setState({ show: false }, () => {
this.removeScrollListener();
this.removeScrollListener(this.state.currentTarget);
if (isVisible && afterHide) {
afterHide(e);
}
Expand Down Expand Up @@ -604,8 +604,9 @@ class ReactTooltip extends React.Component {
window.addEventListener("scroll", this.hideTooltipOnScroll, isCaptureMode);
}

removeScrollListener() {
window.removeEventListener("scroll", this.hideTooltipOnScroll);
removeScrollListener(currentTarget) {
const isCaptureMode = this.isCapture(currentTarget);
window.removeEventListener("scroll", this.hideTooltipOnScroll, isCaptureMode);
}

// Calculation the position
Expand Down