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

stopPropagation() for ng-file-drop to work when $document drop is disabled #339

Closed
wants to merge 1 commit into from

Conversation

alexeygolev
Copy link

I use this to prevent browser from opening file/folder preview when dropped (and navigating you away from the page)

 $document.bind('dragenter', function (e) {
    e.stopPropagation();
    e.preventDefault();
    var dt = e.dataTransfer;
    dt.effectAllowed = dt.dropEffect = 'none';
  });
  $document.bind('dragover', function (e) {
    e.stopPropagation();
    e.preventDefault();
    var dt = e.dataTransfer;
    dt.effectAllowed = dt.dropEffect = 'none';
  });

however it prevents ng-file-drop from working as well. Unless you add stopPropagation on the 'dragover' event.

@danialfarid
Copy link
Owner

What happens if you remove e.stopPropagation() from your code?
If that doesn't work then you can bind this after the angular-file-upload is loaded so that it could have a chance to process the event.

@danialfarid
Copy link
Owner

Added feature directive attribute stop-propagation in version 2.0.0

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.

2 participants