Skip to content

Commit b29da89

Browse files
v1.3.0
1 parent 911a295 commit b29da89

File tree

7 files changed

+2171
-1293
lines changed

7 files changed

+2171
-1293
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Version 1.3.0
2+
Released 2019-05-14
3+
4+
- Added support for touch events
5+
16
# Version 1.2.1
27
Released 2018-09-08
38

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-multi-bar-slider",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "Slider component with multiple bars for React",
55
"repository": {
66
"type": "git",
@@ -22,8 +22,8 @@
2222
"emotion": "^9.x",
2323
"prop-types": "^15.x",
2424
"react": "^15.3.x || ^16.x",
25-
"react-emotion": "^9.x",
26-
"react-dom": "^15.3.x || ^16.x"
25+
"react-dom": "^15.3.x || ^16.x",
26+
"react-emotion": "^9.x"
2727
},
2828
"scripts": {
2929
"build": "webpack --config webpack.config.babel.js",
@@ -54,5 +54,8 @@
5454
"react-emotion": "^9.2.8",
5555
"react-test-renderer": "^16.2.0",
5656
"webpack": "^3.8.1"
57+
},
58+
"jest": {
59+
"testURL": "http://localhost"
5760
}
5861
}

src/MultiSlider/Slider.js

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ const Slider = ({
3333
onMouseUp={onMouseMoveDeactivate}
3434
onMouseLeave={onMouseMoveDeactivate}
3535
onMouseMove={onMouseMove}
36+
onTouchStart={onMouseMoveActivate}
37+
onTouchEnd={onMouseMoveDeactivate}
38+
onTouchCancel={onMouseMoveDeactivate}
39+
onTouchMove={onMouseMove}
3640
{...props}
3741
>
3842
{children}

src/MultiSlider/__tests__/__snapshots__/Slider.test.js.snap

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ exports[`Slider.js matches the snapshot 1`] = `
99
onMouseMove={[Function]}
1010
onMouseUp={[Function]}
1111
onSlide={[Function]}
12+
onTouchCancel={[Function]}
13+
onTouchEnd={[Function]}
14+
onTouchMove={[Function]}
15+
onTouchStart={[Function]}
1216
readOnly={false}
1317
width={1000}
1418
>

src/MultiSlider/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class MultiSlider extends Component {
5656
};
5757

5858
handleMouseMoveActivate = (e) => {
59-
const isLeftButton = e.button === 0;
59+
const isLeftButton = !e.button || e.button === 0;
6060
if (!isLeftButton) return;
6161

6262
if (this.state.mouseDown) return;

src/__tests__/__snapshots__/MultiSlider.test.js.snap

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ exports[`MultiSlider.js matches the snapshot 1`] = `
88
onMouseLeave={[Function]}
99
onMouseMove={[Function]}
1010
onMouseUp={[Function]}
11+
onTouchCancel={[Function]}
12+
onTouchEnd={[Function]}
13+
onTouchMove={[Function]}
14+
onTouchStart={[Function]}
1115
readOnly={false}
1216
width="100%"
1317
>

0 commit comments

Comments
 (0)