Skip to content
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

feat: drop as sibling to open folder #150

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cha0s
Copy link

@cha0s cha0s commented Jun 13, 2023

Somewhat related to #140 and #144

Instead of having to fuss about internal nodes and hovering, it seem to me that the real solution is just to allow dropping nodes as siblings of open folders (and not always as children).

This is a fix I'm testing, though you may identify some issue with it. It seems to do the right thing. I thought I'd start a conversation! :)

@cha0s
Copy link
Author

cha0s commented Jun 13, 2023

I noticed that the parentId is not correct when inspecting onMove. So it definitely needs work.

@cha0s
Copy link
Author

cha0s commented Jun 13, 2023

Pushed a fix that seems to take care of the issue.

@jameskerr
Copy link
Member

jameskerr commented Jun 13, 2023

Thanks for your contribution. You may be trying to achieve something else, but the feature of dropping a node as a sibling to an open folder is already possible. You must drag it to the bottom of it's children, them move the cursor to the left.

In the following video, I drag the item as the sibling of the open folder first, then as a child of the open folder. Notice the dotted line cursor moving between indent levels. This indicates where it will placed, sibling or child.

CleanShot.2023-06-13.at.12.17.54.mp4

Are you trying to achieve something different? Maybe you can record a video of your desired behavior.

Thanks!

@cha0s
Copy link
Author

cha0s commented Jun 14, 2023

My use case is a tree with nodes that all have a children array (in other words, they may all be arranged as children of each other).

Without this fix, it is not possible to move any node as a sibling of another; you are only allowed to move them under each other.

I can provide a video if you need.

@cha0s
Copy link
Author

cha0s commented Jun 14, 2023

My comment may not have been clear about the fact that I do understand the 'drag left' behavior! This PR just allows you to drag left in the case that I described, when all nodes are open folders.

@jameskerr
Copy link
Member

I think I see what you mean. If you could provide a demo of the library not working, that would be helpful. I'll need to test this. Thanks for the contribution.

@TheMichaelLant
Copy link

Agree on this, having same issues

@killerbane
Copy link

Any progress on this? Would love to see this merged..

@jameskerr
Copy link
Member

Ok, I think I see the issue here. If anyone would like to make a demo showcasing how to have a tree full of open nodes, that would help move this along. Otherwise, I'll need to get around to making an example to test.

I'll also need to ensure the current behavior doesn't break.

@edimov
Copy link

edimov commented Dec 9, 2023

I believe I've been having the same issues. In short I needed to be able to add siblings to open empty non-leaf nodes. This PR should solve the problem: #199

There are two videos in the PR description showing the problem and the solved variant. Thank you for an awesome package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants