File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed
Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,9 @@ class SwipeListView extends PureComponent {
236236 item . leftActionValue || this . props . leftActionValue || 0
237237 }
238238 rightActionValue = {
239- item . rightActionValue || this . props . rightActionValue || 0
239+ item . rightActionValue ||
240+ this . props . rightActionValue ||
241+ 0
240242 }
241243 initialLeftActionState = {
242244 item . initialLeftActionState ||
@@ -332,6 +334,7 @@ class SwipeListView extends PureComponent {
332334 swipeToClosePercent = { this . props . swipeToClosePercent }
333335 item = { item } // used for should item update comparisons
334336 useNativeDriver = { this . props . useNativeDriver }
337+ onPreviewEnd = { this . props . onPreviewEnd }
335338 >
336339 { HiddenComponent }
337340 { VisibleComponent }
@@ -684,6 +687,10 @@ SwipeListView.propTypes = {
684687 * keyExtractor: function to generate key value for each row in the list
685688 */
686689 keyExtractor : PropTypes . func ,
690+ /**
691+ * Callback that runs after row swipe preview is finished
692+ */
693+ onPreviewEnd : PropTypes . func ,
687694} ;
688695
689696SwipeListView . defaultProps = {
Original file line number Diff line number Diff line change @@ -253,7 +253,9 @@ class SwipeRow extends Component {
253253 previewOpenValue ,
254254 this . props . previewOpenDelay
255255 ) . start ( ( ) => {
256- this . getPreviewAnimation ( 0 , PREVIEW_CLOSE_DELAY ) . start ( ) ;
256+ this . getPreviewAnimation ( 0 , PREVIEW_CLOSE_DELAY ) . start ( ( ) => {
257+ this . props . onPreviewEnd && this . props . onPreviewEnd ( ) ;
258+ } ) ;
257259 } ) ;
258260 }
259261
@@ -910,6 +912,10 @@ SwipeRow.propTypes = {
910912 * Key used to identify rows on swipe value changes
911913 */
912914 swipeKey : PropTypes . string ,
915+ /**
916+ * Callback that runs after row swipe preview is finished
917+ */
918+ onPreviewEnd : PropTypes . func ,
913919} ;
914920
915921SwipeRow . defaultProps = {
Original file line number Diff line number Diff line change @@ -62,5 +62,6 @@ A List that renders `<SwipeRow />`s
6262| ` shouldItemUpdate ` | Callback to determine whether component should update | ` func ` | ` { currentItem: any, newItem: any } ` |
6363| ` useNativeDriver ` | useNativeDriver: ` true ` for all animations | ` bool ` | ` true ` |
6464| ` useAnimatedList ` | Use Animated.Flatlist or Animated.Sectionlist | ` bool ` | ` false ` |
65+ | ` onPreviewEnd ` | Callback that runs after row swipe preview is finished | ` func ` | ` { } : void ` |
6566
6667See [ FlatList] ( https://reactnative.dev/docs/flatlist ) for all other inherited props
Original file line number Diff line number Diff line change 6565| ` onForceCloseToRightEnd ` | Callback invoked when row has finished force closing to the Right End | ` func ` |
6666| ` useNativeDriver ` | useNativeDriver: ` true ` for all animations | ` bool ` | ` true ` |
6767| ` swipeKey ` | Optional key to identify a standalone row, used in the ` onSwipeValueChange ` callback | ` string ` |
68+ | ` onPreviewEnd ` | Callback that runs after row swipe preview is finished | ` func ` | ` { } : void ` |
You can’t perform that action at this time.
0 commit comments