Skip to content

Commit

Permalink
fix: should get view length from the container node
Browse files Browse the repository at this point in the history
  • Loading branch information
Berton Zhu committed Jun 23, 2021
1 parent a12dd90 commit db330b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-swipeable-views/src/SwipeableViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ class SwipeableViews extends React.Component {

const touch = applyRotationMatrix(event.touches[0], axis);

this.viewLength = this.rootNode.getBoundingClientRect()[axisProperties.length[axis]];
this.viewLength = this.containerNode.getBoundingClientRect()[axisProperties.length[axis]];
this.startX = touch.pageX;
this.lastX = touch.pageX;
this.vx = 0;
Expand Down

0 comments on commit db330b9

Please sign in to comment.