2

I have implemented file drop using ng2 file upload . The problem i am facing is that when the file is dropped outside the drop area browser opens it. Is there any way to prevent this event ? angular2/4

Sachin Jijo
  • 121
  • 8

1 Answers1

6

yes finally got it working .I hope it will be helpful for developers. just add this to the component tags.

    onDragStart="return false;" ondragenter="return 
    false;" ondragover="return false;" ondrop="return false;"

eg:

    <div class="row" onDragStart="return false;" ondragenter="return 
    false;" ondragover="return false;" ondrop="return false;">
Sachin Jijo
  • 121
  • 8
  • 1
    nice post. I was also searching for this issue, thanks, but this code should be added to main div of the component html – Sathish Kotha Sep 07 '17 at 17:05