react-native-draggable-flatlist icon indicating copy to clipboard operation
react-native-draggable-flatlist copied to clipboard

`ItemSeparatorComponent` is translated next to the active element

Open outaTiME opened this issue 2 years ago • 1 comments

Hello there, I am using a FlatList with ItemSeparatorComponent and it is moved along with the active item (on the drag), is this an expected behavior? I think only the renderItem should be translated.

CleanShot 2022-12-28 at 15 53 00

Platform & Dependencies

  • react-native-draggable-flatlist version: 4.0.0
  • Platform: Mac
  • React Native or Expo version: Expo 47
  • Reanimated version: 2.13.0
  • React Native Gesture Handler version: 2.8.0

outaTiME avatar Dec 28 '22 19:12 outaTiME

I am seeing an issue related to this, where swapping the last 2 items in a list causes a 'snapping' animation. When you swap the last items, the last item doesnt have a separator component below it, only above it, so when its swapped with the second-last item, the last item snaps as it recalculates the height to now include an ItemSeparatorComponent.

My fix was to move my separator component to within the renderItem function instead of passing in via ItemSeparatorComponent prop.

stephenseager avatar Sep 21 '23 09:09 stephenseager