nuclearpasta / react-native-drax

A drag-and-drop system for React Native
MIT License
554 stars 68 forks source link

Enhance DraxList onItemDragPositionChange to recognize original position index #45

Open lafiosca opened 4 years ago

lafiosca commented 4 years ago

The new logic in #42 introduces the DraxList onItemDragPositionChange event handler property. When dragging an item over any other item in the list, that callback receives the position index of the item being dragged over. When dragged anywhere else, including the dragged item's original position, the list header/footer, or outside the list, the callback receives an undefined index. It might be nice for the callback to receive the item's original position index rather than undefined when dragging over the item's own position. This would require additional logic in the DraxList monitoring because the original item can't receive its own drag like the rest of the list items do.