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

Prevent Dragging Files to Specific Folders #92

Closed
graywolf336 opened this issue Jun 6, 2021 · 2 comments
Closed

Prevent Dragging Files to Specific Folders #92

graywolf336 opened this issue Jun 6, 2021 · 2 comments

Comments

@graywolf336
Copy link

First of all, thank you so much for creating this project and keeping it up!!

My question pertains to drag and drop. Is there a way to customize where files can be dragged to? Let's take the following folder structure as an example:

Parent Folder
├── A
├── file.zip
├── B
│   ├── C
│   │   ├── image.jpg

I want to prevent dragging the file.zip into the folder A but want to allow it inside of B and the subfolders.

Is there a way to do this currently?

@TimboKZ
Copy link
Owner

TimboKZ commented Jun 6, 2021

You can set droppable: false on folder A to prevent any files from being dropped into it.

Targeting .zip files specifically will be a bit harder, you'll need to listen to the StartDragNDrop action in your action handler and update folder A's file object accordingly.

@graywolf336
Copy link
Author

I believe that’s precisely what I needed to know, or at least provides me direction to it. Thank you!

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

No branches or pull requests

2 participants