-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onMove receives inconsistent parentId and index #247
Comments
Same here, moving a node from a nested node to another one get an incorrect index, then if you move the node inside the same level the index is correct. |
Yes. Same here. onMove is giving incorrect position. at root level, if there are two nodes, it am getting position as 2 whereas it should have been 1. |
Possible solution? instead of get the index from the args in onMove, yo can get the proper one from the tree state like this, where tree is the ref to the component. tree.state.dnd.index; |
Will try this |
@surajair the index in the state has the same problem, dragging the node upward the index is increased by 1, you can calculate the direction getting the old rowIndex of the node from the tree instance |
Inconsistent index
Cursor would imply new index should be 1 but is reported as 2
Inconsistent parentId
Cursor and
node.willReceiveDrop
indicates that a drop will NOT happen, yetparentId
is that of theBox
rather thanContainer
This behaviour only happens after first moving
Slider
into aBox
, then out again. Somehow thatSlider
continues to receive theBox
as the parent when being moved. It should also be noted that those boxes are internal nodes in all cases, i.e.children
is always an arrayThe text was updated successfully, but these errors were encountered: