Skip to content

Commit fce6ef1

Browse files
author
Claudéric Demers
authored
fix: timing issue in Chrome caused by setTimeout when pressDelay is 0
2 parents 5b3c094 + 806685a commit fce6ef1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/SortableContainer/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ export default function SortableContainer(WrappedComponent, config = {withRef: f
126126
this.manager.active = {index, collection};
127127

128128
if (!distance) {
129-
this.pressTimer = setTimeout(() => this.handlePress(e), this.props.pressDelay);
129+
if (this.props.pressDelay === 0) {
130+
this.handlePress(e);
131+
} else {
132+
this.pressTimer = setTimeout(() => this.handlePress(e), this.props.pressDelay);
133+
}
130134
}
131135
}
132136
};

0 commit comments

Comments
 (0)