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

Activate parent dropzone only after draggable leaves child dropzone #552

Closed
zuzusik opened this issue Oct 27, 2017 · 4 comments
Closed

Activate parent dropzone only after draggable leaves child dropzone #552

zuzusik opened this issue Oct 27, 2017 · 4 comments

Comments

@zuzusik
Copy link

zuzusik commented Oct 27, 2017

I have following conditions:

  • I have nested dropzones, every has draggables.

  • I need to be able to drag and drop between these dropzones - from child to parent and vice versa.

  • I’ve added checkers - if dropzone has this draggable - dropping is not allowed - so when I pick up item that is already in dropzone - its own dropzone is not activated.

But when I start dragging element in whatever nested dropzone - the parent dropzone is being activated.

Here is the picture illustrating this behavior:

Is it possible to achieve the behavior when parent dropzone is being activated only when draggable leaves the current (disabled by checker) dropzone?

@taye
Copy link
Owner

taye commented Oct 30, 2017 via email

@zuzusik
Copy link
Author

zuzusik commented Oct 30, 2017

@taye hmm, not sure I am getting what you wanted to say here

I'll try to add bit more of explanation to my image:

The red ones are dropzones and blue ones are draggable.

I need to drag blue one from DZ3 to DZ2, but when I just start dragging it - DZ2 gets activated. This happens because DZ3 is disabled by checker, and so interact.js activates DZ2.

I need DZ2 to get activated only when blue one leaves DZ3.

@taye
Copy link
Owner

taye commented Nov 1, 2017

I meant to sort of cut the dropzones which have dropzones nested in them into four different elements which surround (but are not overlapped by) the child dropzone.

screen

You could also change the drop checker so that it allows drops to full elements, but do nothing when dropactivate, dragenter and drop events happen on full dropzones.

@taye
Copy link
Owner

taye commented Mar 21, 2018

@zuzusik I'm working on a DropEvent.reject() method in #613 that I think would solve your issue. With it you could allow the child dropzone to be activated, but then reject the dragenter and prevent a drop from happening.

@taye taye mentioned this issue Mar 23, 2018
2 tasks
@taye taye closed this as completed Mar 23, 2018
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