From 54d45495c6fd253b9f5075092007cbff64d255d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fatay=20=C3=87ivici?= Date: Mon, 8 Oct 2018 10:47:58 +0300 Subject: [PATCH] Refactor events --- src/components/slider/Slider.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/slider/Slider.js b/src/components/slider/Slider.js index f50c0e704f..21c865ddca 100644 --- a/src/components/slider/Slider.js +++ b/src/components/slider/Slider.js @@ -40,6 +40,10 @@ export class Slider extends Component { this.onBarClick = this.onBarClick.bind(this); } + componentWillUnmount() { + this.unbindDragListeners(); + } + onMouseDown(event, index) { if(this.disabled) { return; @@ -82,6 +86,8 @@ export class Slider extends Component { else this.props.onSlideEnd({originalEvent: event, value: this.value}); } + + this.unbindDragListeners(); } }