Has anyone encountered an issue with an angular directive that is not successfully preventing Chrome's default action?
Below is the code for the directive in question:
app.directive('fileDrag', function () {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
elem.bind('drop', function(e){
e.preventDefault();
console.log(e);
return false;
});
}
};
});
Here is the corresponding html snippet:
<div style="width: 500px; height:500px; background-color: red;" file-drag></div>
I am facing difficulties getting Chrome to refrain from opening the image in a new tab when dragging it onto the specified element. Any suggestions on how to resolve this issue?