react-complex-tree
react-complex-tree copied to clipboard
OnDrop returns not correct childIndex for target.targetType = 'between-items'
trafficstars
Describe the bug
Hi! I understand that this could be intentional, but when I drop 'between-items' I don't get expected target.childIndex.
To Reproduce
- Create a tree with 3 items in the root, let's name them A,B,C. Enable reordering of items. Log
targetobject inonDropcallback - Drag item C to the beginning, observe
target.childIndex = 0which is expected - Drag item C between A and B, observe
target.childIndex = 2
Expected behavior
I expect that in step 3 I get childIndex = 1. Could you confirm that above behavior is correct?
Screenshots
Desktop (please complete the following information):
- OS: MacOS
- Browser Chrome
- Version 22
Additional context
My goal is too get new order position of the item. Right now I can't do this by using onDrop. If you could recommend how to better get new position order that would be great!