File tree 2 files changed +27
-4
lines changed
2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ module.exports = {
37
37
modules : true
38
38
}
39
39
} ,
40
- { loader : 'postcss-loader' }
40
+ {
41
+ loader : 'postcss-loader' ,
42
+ options : {
43
+ config : {
44
+ path : path . join ( __dirname , 'src' , 'examples' )
45
+ }
46
+ }
47
+ }
41
48
]
42
49
}
43
50
]
Original file line number Diff line number Diff line change @@ -102,12 +102,28 @@ class SwipeableListItem extends PureComponent {
102
102
requestAnimationFrame ( this . updatePosition ) ;
103
103
} ;
104
104
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 ) ;
106
110
107
- handleMouseMove = event => this . handleMove ( event , event ) ;
111
+ if ( this . isSwiping ( ) ) {
112
+ event . stopPropagation ( ) ;
113
+ event . preventDefault ( ) ;
108
114
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 => {
110
124
if ( this . dragStartedWithinItem ( ) ) {
125
+ const { clientX, clientY } = event . targetTouches [ 0 ] ;
126
+
111
127
this . setDragDirection ( clientX , clientY ) ;
112
128
113
129
if ( ! event . cancelable ) {
You can’t perform that action at this time.
0 commit comments