preventing browser from loading a file drop outside the drop tag

1.1k views Asked by At

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

1

There are 1 answers

1
Sachin Jijo On

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;">