Skip to content

Commit f3ae26a

Browse files
kolkingjgonet
andauthored
Adjust overshootFriction behavior (#1275)
Co-authored-by: Jakub Gonet <jakub.gonet@swmansion.com>
1 parent 27e61dc commit f3ae26a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/components/Swipeable.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,12 @@ export default class Swipeable extends Component<
255255
outputRange: [0, 1],
256256
})
257257
).interpolate({
258-
inputRange: [
259-
-rightWidth - (overshootRight ? 1 : overshootFriction!),
260-
-rightWidth,
261-
leftWidth,
262-
leftWidth + (overshootLeft ? 1 : overshootFriction!),
263-
],
258+
inputRange: [-rightWidth - 1, -rightWidth, leftWidth, leftWidth + 1],
264259
outputRange: [
265-
-rightWidth - (overshootRight || overshootFriction! > 1 ? 1 : 0),
260+
-rightWidth - (overshootRight ? 1 / overshootFriction! : 0),
266261
-rightWidth,
267262
leftWidth,
268-
leftWidth + (overshootLeft || overshootFriction! > 1 ? 1 : 0),
263+
leftWidth + (overshootLeft ? 1 / overshootFriction! : 0),
269264
],
270265
});
271266
this.transX = transX;

0 commit comments

Comments
 (0)