Skip to content

Commit 3633c1b

Browse files
authored
Add minDistanceForAction and minDistanceToCapture props for swiper (#857)
1 parent 0332b5f commit 3633c1b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/core/src/components/Swiper/Swiper.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export interface SwiperProps<T> {
2323
renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;
2424
style?: StyleProp<ViewStyle>;
2525
onIndexChanged?: (index: number) => void;
26+
minDistanceForAction?: number;
27+
minDistanceToCapture?: number;
2628
}
2729

2830
const Swiper = ({
@@ -45,6 +47,8 @@ const Swiper = ({
4547
onSwipe,
4648
onSwipedNext,
4749
onSwipedPrevious,
50+
minDistanceForAction,
51+
minDistanceToCapture,
4852
style,
4953
}: SwiperProps<any>) => {
5054
const [currentIndex, setCurrentIndex] = React.useState(0);
@@ -119,6 +123,8 @@ const Swiper = ({
119123
timeout={timeout}
120124
vertical={vertical}
121125
onIndexChanged={onIndexChanged}
126+
minDistanceForAction={minDistanceForAction}
127+
minDistanceToCapture={minDistanceToCapture}
122128
controlsProps={{
123129
prevTitle,
124130
nextTitle,

0 commit comments

Comments
 (0)