File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -170,10 +170,12 @@ class SwipeableListItem extends PureComponent {
170
170
if ( this . isSwiping ( ) ) {
171
171
const threshold = this . props . threshold || 0.5 ;
172
172
173
- if ( this . left < this . listElement . offsetWidth * threshold * - 1 ) {
174
- this . handleSwipedLeft ( ) ;
175
- } else if ( this . left > this . listElement . offsetWidth * threshold ) {
176
- this . handleSwipedRight ( ) ;
173
+ if ( this . listElement ) {
174
+ if ( this . left < this . listElement . offsetWidth * threshold * - 1 ) {
175
+ this . handleSwipedLeft ( ) ;
176
+ } else if ( this . left > this . listElement . offsetWidth * threshold ) {
177
+ this . handleSwipedRight ( ) ;
178
+ }
177
179
}
178
180
179
181
if ( this . props . onSwipeEnd ) {
@@ -311,11 +313,13 @@ class SwipeableListItem extends PureComponent {
311
313
return ;
312
314
}
313
315
314
- this . listElement . style . transform = `translateX(${ this . left } px)` ;
316
+ if ( this . listElement ) {
317
+ this . listElement . style . transform = `translateX(${ this . left } px)` ;
318
+ }
315
319
316
320
const opacity = ( Math . abs ( this . left ) / 100 ) . toFixed ( 2 ) ;
317
321
318
- if ( this . props . onSwipeProgress && this . listElement !== null ) {
322
+ if ( this . props . onSwipeProgress && this . listElement ) {
319
323
const listElementWidth = this . listElement . offsetWidth ;
320
324
let swipeDistancePercent = this . previousSwipeDistancePercent ;
321
325
You can’t perform that action at this time.
0 commit comments