fix: fix closing stack using inverted gesture. (#7824)

Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
This commit is contained in:
Alexey Vlasenko
2020-03-19 20:32:29 +02:00
committed by GitHub
parent 3df65e2819
commit f24d3a3461

View File

@@ -271,6 +271,14 @@ export default class Card extends React.Component<Props> {
velocity = nativeEvent.velocityX;
}
if (
gestureDirection === 'horizontal-inverted' ||
gestureDirection === 'vertical-inverted'
) {
translation *= -1;
velocity *= -1;
}
const closing =
translation + velocity * gestureVelocityImpact > distance / 2
? velocity !== 0 || translation !== 0