angular-file-upload icon indicating copy to clipboard operation
angular-file-upload copied to clipboard

onDragLeave is not working

Open rreddyNg opened this issue 8 years ago • 6 comments

on Chrome on Windows when you drag the file from the operating system to the drop zone, the style changes to the drop zone are applied. However, if you do not drop, and leave the drop zone, the style does not go away.

rreddyNg avatar Feb 15 '17 21:02 rreddyNg

When will you be releasing #719?

dhtor avatar Feb 16 '17 03:02 dhtor

please merge the fix for this issue. I'm waiting for it.

gertot avatar May 24 '17 05:05 gertot

I was able to fix this issue by tweaking the following line 1813: if (event.currentTarget === this.element[0]) return;

becomes if (event.currentTarget !== this.element[0]) return;

My understanding is that this check is required depending on whether the element the nv-file-drop directive is applied to is the same element as the overlay. So to avoid the previous 'flicker' issue and also fix the Drag Leave bug this should do the trick. Unless I'm mistaken. Either way if you are using the same element as the drop zone commenting this line out should also do the trick.

jameseddyedwards avatar Jun 29 '17 16:06 jameseddyedwards

you can make something like this, in your controller where you use FileUploader, before make instance of it you can type

FileUploader.FileDrop.prototype.onDragLeave = function onDragLeave(event) {
            if (event.currentTarget !== this.element[0]) {return;} // some fix code here
            this._preventAndStop(event);
            angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
};

TimurKastemirov avatar Feb 07 '19 16:02 TimurKastemirov

you can make something like this, in your controller where you use FileUploader, before make instance of it you can type

FileUploader.FileDrop.prototype.onDragLeave = function onDragLeave(event) {
            if (event.currentTarget !== this.element[0]) {return;} // some fix code here
            this._preventAndStop(event);
            angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
};

This won't work in my case - uploader goes mad when you drag the element over and when you drop it - just opens the image in browser.

heyantonvolkov avatar Aug 22 '19 08:08 heyantonvolkov

you can make something like this, in your controller where you use FileUploader, before make instance of it you can type

FileUploader.FileDrop.prototype.onDragLeave = function onDragLeave(event) {
            if (event.currentTarget !== this.element[0]) {return;} // some fix code here
            this._preventAndStop(event);
            angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
};

This won't work in my case - uploader goes mad when you drag the element over and when you drop it - just opens the image in browser.

ты походу промахиваешься и не попадаешь в область драг и дропа, если у тебя открывается картинка)))) сделай при перетягивании файла на область, чтобы она подсвечивалась) вот на, попробуй тут ======> https://jsfiddle.net/TimurKatemirov/dg9te60s/27/ специально для тебя.

TimurKastemirov avatar Aug 23 '19 07:08 TimurKastemirov