Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ Receives swipe direction as an argument.
a function that is called when `swipeable` starts animating on close.
Receives swipe direction as an argument.

### `onSwipeableDragEnd`

a function that is called when `swipeable` ends dragging.
Receives swipe direction as an argument.

### `onSwipeableOpenStartDrag`

a function that is called when a user starts to drag the `swipable` to open.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const Swipeable = (props: SwipeableProps) => {
onSwipeableWillClose,
onSwipeableOpen,
onSwipeableClose,
onSwipeableDragEnd,
renderLeftActions,
renderRightActions,
simultaneousWithExternalGesture,
Expand Down Expand Up @@ -457,6 +458,10 @@ const Swipeable = (props: SwipeableProps) => {
}
}

if(onSwipeableDragEnd){
runOnJS(onSwipeableDragEnd)(toValue < 0 || Object.is(toValue, -0) ? SwipeDirection.RIGHT : SwipeDirection.LEFT);
}

animateRow(toValue, velocityX / friction);
},
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ export interface SwipeableProps {
direction: SwipeDirection.LEFT | SwipeDirection.RIGHT
) => void;

/**
* Called when action panel drag ends.
*/
onSwipeableDragEnd?: (
direction: SwipeDirection.LEFT | SwipeDirection.RIGHT
) => void;

/**
* Called when action panel starts being shown on dragging to open.
*/
Expand Down