From 2aeb8754c095a57f4ee67d70f1d8db35e4d27168 Mon Sep 17 00:00:00 2001 From: Ted Driggs Date: Fri, 19 Oct 2018 14:35:07 -0700 Subject: [PATCH] Remove scroll event listener in removeListeners Fixes #14 --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4448ad3..ac97e7e 100644 --- a/src/index.js +++ b/src/index.js @@ -336,8 +336,9 @@ export default class Scrollbar extends React.Component removeListeners = () => { if (!isset(document) || !this.content) { return this; } - const {trackVertical, trackHorizontal, thumbVertical, thumbHorizontal} = this; + const {content, trackVertical, trackHorizontal, thumbVertical, thumbHorizontal} = this; + content.removeEventListener("scroll", this.handleScrollEvent, { passive: true }); trackVertical.removeEventListener("mousedown", this.handleTrackVerticalMousedownEvent); trackHorizontal.removeEventListener("mousedown", this.handleTrackHorizontalMousedownEvent); thumbVertical.removeEventListener("mousedown", this.handleThumbVerticalMousedownEvent);