-
Notifications
You must be signed in to change notification settings - Fork 96
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
[feature] Expose newly created items list in confirmChange #112
Comments
hi. you can simply check if new parent is the same as current parent, then it is reordering, so you can prevent that. does that make sense? |
Hi @primetwig, thanks for getting back to me so quickly! However, I am not able to find a way to make it work when reordering top-level items. For my use case, I want to "hardcode" item A at index 0, but allow items B and C to move. I use the
The problem happens when I try to move B to index 0.
props to For these top-level item changes, the destinationParent is always null. There is nothing sent to confirmChange that can tell me a little more context about the other items that have changed, so we can asses the validity of the move. |
I see. It looks like destination index or the whole path (like in |
May I suggest you simply move the Edit: like |
the thing is that moving item into position may have several options as to final result and I need to consider all of them.
when you move A over B, it checks if it is allowed to put A into B, but in case it is not – it should also check if it is allowed to swap A with B, thought it does not check that. |
PR open here: #113 Thanks for this library! |
Description
Issue: Using the provided props users are able to prevent dragging of items, however we cannot prevent the re-ordering of items.
Feature Request - expose the new list of items in the confirmChange function. Allow consumers to use this data when evaluating a change.
Additional context
Will provide a PR for this change 😄
The text was updated successfully, but these errors were encountered: