Skip to content

Commit b767c8b

Browse files
committed
Fix buggy direction changing
Sometimes when slowly swiping a row in one direction, it intermittently toggles between left/right. This seems to solve that.
1 parent 90afe98 commit b767c8b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/SwipeRow.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ class SwipeRow extends Component {
7272
this.currentTranslateX = value;
7373
if (this.props.onSwipeValueChange) {
7474
let direction = this.previousTrackedDirection;
75-
if (value !== this.previousTrackedTranslateX) {
75+
if (
76+
value !== this.previousTrackedTranslateX &&
77+
Math.abs(value - this.previousTrackedTranslateX) > 0.5
78+
) {
7679
direction =
7780
value > this.previousTrackedTranslateX
7881
? 'right'

0 commit comments

Comments
 (0)