diff --git a/src/Rangeslider.js b/src/Rangeslider.js index 9bd8aa1..564e5ee 100755 --- a/src/Rangeslider.js +++ b/src/Rangeslider.js @@ -106,9 +106,12 @@ class Slider extends Component { * @return {void} */ handleStart = e => { - const { onChangeStart } = this.props - document.addEventListener('mousemove', this.handleDrag) - document.addEventListener('mouseup', this.handleEnd) + const { onChangeStart } = this.props; + document.addEventListener('mousemove', this.handleDrag); + document.addEventListener('mouseup', this.handleEnd); + document.addEventListener('touchmove', this.handleDrag); + document.addEventListener('touchend', this.handleEnd); + this.setState( { active: true @@ -157,8 +160,10 @@ class Slider extends Component { onChangeComplete && onChangeComplete(e) } ) - document.removeEventListener('mousemove', this.handleDrag) - document.removeEventListener('mouseup', this.handleEnd) + document.removeEventListener('mousemove', this.handleDrag); + document.removeEventListener('mouseup', this.handleEnd); + document.removeEventListener('touchmove', this.handleDrag); + document.removeEventListener('touchend', this.handleEnd); }; /**