You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add optional onPlaceholderIndexChange callback function (#212)
* Add optional `onSpacerIndexChange` callback function to the props to trigger when the spacer index changes.
* Refactor property name and change README.md
- Change `onSpacerIndexChange` to `onPlaceholderIndexChange`
- Add new `onSpacerIndexChange` to the README.md
|`renderItem`|`(params: { item: T, index: number, drag: () => void, isActive: boolean}) => JSX.Element`| Call `drag` when the row should become active (i.e. in an `onLongPress` or `onPressIn`). |
39
-
|`renderPlaceholder`|`(params: { item: T, index: number }) => React.ReactNode`| Component to be rendered underneath the hovering component |
40
-
|`keyExtractor`|`(item: T, index: number) => string`| Unique key for each item |
41
-
|`onDragBegin`|`(index: number) => void`| Called when row becomes active. |
42
-
|`onRelease`|`(index: number) => void`| Called when active row touch ends. |
43
-
|`onDragEnd`|`(params: { data: T[], from: number, to: number }) => void`| Called after animation has completed. Returns updated ordering of `data`|
44
-
|`autoscrollThreshold`|`number`| Distance from edge of container where list begins to autoscroll when dragging. |
45
-
|`autoscrollSpeed`|`number`| Determines how fast the list autoscrolls. |
|`animationConfig`|`Partial<Animated.SpringConfig>`| Configure list animations. See [reanimated spring config](https://github.com/software-mansion/react-native-reanimated/blob/master/react-native-reanimated.d.ts#L112-L120)|
48
-
|`activationDistance`|`number`| Distance a finger must travel before the gesture handler activates. Useful when using a draggable list within a TabNavigator so that the list does not capture navigator gestures. |
49
-
|`layoutInvalidationKey`|`string`| Changing this value forces a remeasure of all item layouts. Useful if item size/ordering updates after initial mount. |
50
-
|`onScrollOffsetChange`|`(offset: number) => void`| Called with scroll offset. Stand-in for `onScroll`. |
51
-
|`dragItemOverflow`|`boolean`| If true, dragged item follows finger beyond list boundary. |
|`renderItem`|`(params: { item: T, index: number, drag: () => void, isActive: boolean}) => JSX.Element`| Call `drag` when the row should become active (i.e. in an `onLongPress` or `onPressIn`). |
39
+
|`renderPlaceholder`|`(params: { item: T, index: number }) => React.ReactNode`| Component to be rendered underneath the hovering component |
40
+
|`keyExtractor`|`(item: T, index: number) => string`| Unique key for each item |
41
+
|`onDragBegin`|`(index: number) => void`| Called when row becomes active. |
42
+
|`onRelease`|`(index: number) => void`| Called when active row touch ends. |
43
+
|`onDragEnd`|`(params: { data: T[], from: number, to: number }) => void`| Called after animation has completed. Returns updated ordering of `data`|
44
+
|`autoscrollThreshold`|`number`| Distance from edge of container where list begins to autoscroll when dragging. |
45
+
|`autoscrollSpeed`|`number`| Determines how fast the list autoscrolls. |
|`animationConfig`|`Partial<Animated.SpringConfig>`| Configure list animations. See [reanimated spring config](https://github.com/software-mansion/react-native-reanimated/blob/master/react-native-reanimated.d.ts#L112-L120)|
48
+
|`activationDistance`|`number`| Distance a finger must travel before the gesture handler activates. Useful when using a draggable list within a TabNavigator so that the list does not capture navigator gestures. |
49
+
|`layoutInvalidationKey`|`string`| Changing this value forces a remeasure of all item layouts. Useful if item size/ordering updates after initial mount. |
50
+
|`onScrollOffsetChange`|`(offset: number) => void`| Called with scroll offset. Stand-in for `onScroll`. |
51
+
|`onPlaceholderIndexChange`|`(index: number) => void`| Called when the index of the placeholder changes |
52
+
|`dragItemOverflow`|`boolean`| If true, dragged item follows finger beyond list boundary. |
0 commit comments