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

Allow drag of multiple items to target folder. Each item does not have to start in the same source folder. #90

Closed
eoinomeara11 opened this issue Dec 21, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@eoinomeara11
Copy link

The Multiple selections(checkbox) example does allow multiple select but does not allow multiple drag.

@eoinomeara11 eoinomeara11 added the enhancement New feature or request label Dec 21, 2021
@mattevans-dev
Copy link

Great library @minop1205, just having the same issue regarding multiple selection and dragging. Any chance this may be fixed in a future version soon?

@minop1205
Copy link
Owner

@mattevans-dev Multiple item dragging is discussed in the following Issue, but since react-dnd, the dependent library for this package, does not support multiple item dragging, it would be difficult to provide it as a feature of this library.

react-dnd/react-dnd#14

However, as mentioned in the following comment, I think it is possible to achieve this functionality in a pseudo way by remembering the selection state in the application code on the side of the user of the package.

react-dnd/react-dnd#14 (comment)

We believe that using this method we can achieve multiple item drag and drop in the current version of react-dnd-treeview.
We will add a sample for this soon, but it will be at a later time.

@mattevans-dev
Copy link

Thanks for the detailed reply @minop1205, that's really useful. I'll try implementing it based on the react-dnd comment.
Keep up the great work!

@minop1205
Copy link
Owner

Demos and sample code of multiple drags are available here.

As noted in the demo screen, this package itself does not have multiple drag functionality, so the logic for the operation must be written on the main application side.

In this case, it is convenient to have drag start and end events, so we have added the onDragStart and onDragEnd APIs in v3.1.

Demo(Storybook)

multiple-drag-demo

https://minop1205.github.io/react-dnd-treeview/?path=/story/examples-tree-multiple-drag--multiple-drag-story

Code(Codesandbox)

JavaScript: https://codesandbox.io/s/multiple-drag-js-m3ut0u?from-embed=&file=/src/App.jsx
TypeScript: https://codesandbox.io/s/multiple-drag-ts-nf0m3k?from-embed=&file=/src/App.tsx

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

No branches or pull requests

3 participants