File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Version 1.3.0
2+ Released 2019-05-14
3+
4+ - Added support for touch events
5+
16# Version 1.2.1
27Released 2018-09-08
38
Original file line number Diff line number Diff line change 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" ,
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" ,
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}
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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>
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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>
You can’t perform that action at this time.
0 commit comments