File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ module.exports = {
3737 modules : true
3838 }
3939 } ,
40- { loader : 'postcss-loader' }
40+ {
41+ loader : 'postcss-loader' ,
42+ options : {
43+ config : {
44+ path : path . join ( __dirname , 'src' , 'examples' )
45+ }
46+ }
47+ }
4148 ]
4249 }
4350 ]
Original file line number Diff line number Diff line change @@ -102,12 +102,28 @@ class SwipeableListItem extends PureComponent {
102102 requestAnimationFrame ( this . updatePosition ) ;
103103 } ;
104104
105- handleTouchMove = event => this . handleMove ( event , event . targetTouches [ 0 ] ) ;
105+ handleMouseMove = event => {
106+ if ( this . dragStartedWithinItem ( ) ) {
107+ const { clientX, clientY } = event ;
108+
109+ this . setDragDirection ( clientX , clientY ) ;
106110
107- handleMouseMove = event => this . handleMove ( event , event ) ;
111+ if ( this . isSwiping ( ) ) {
112+ event . stopPropagation ( ) ;
113+ event . preventDefault ( ) ;
108114
109- handleMove = ( event , { clientX, clientY } ) => {
115+ const delta = clientX - this . dragStartPoint . x ;
116+ if ( this . shouldMoveItem ( delta ) ) {
117+ this . left = delta ;
118+ }
119+ }
120+ }
121+ } ;
122+
123+ handleTouchMove = event => {
110124 if ( this . dragStartedWithinItem ( ) ) {
125+ const { clientX, clientY } = event . targetTouches [ 0 ] ;
126+
111127 this . setDragDirection ( clientX , clientY ) ;
112128
113129 if ( ! event . cancelable ) {
You can’t perform that action at this time.
0 commit comments