-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
nvFileOver's class doesn't get removed when file is moved out from the element #231
Comments
Just a little screen capture: http://cl.ly/3G1T3l211O1l |
same here .. |
Same here for Steps to reproduce:javascript:angular
.module('app', ['angularFileUpload'])
.controller('AppController', function($scope, FileUploader) {
$scope.uploader = new FileUploader();
}); css:.nv-file-over { border: none !important; }
.buggy-drop-zone {
width : 400px;
height : 400px;
border : 0;
}
.buggy-drop-zone * {
border-color : black;
border : solid;
width : 100%;
height : 100%;
}
.buggy-drop-zone.nv-file-over * {
background : red;
} html (interesting part):<div ng-app="app">
<div ng-controller="AppController"
class="buggy-drop-zone"
nv-file-over
nv-file-drop=""
uploader="uploader"
>
<div>
</div>
</div>
</div> When we drag file into the For workaround you can use something like that:.buggy-drop-zone * { pointer-events : none; } |
I think that current behavior is incorrect. For example: .drop-zone {
height : 200px;
width : 300px;
border : solid 1px black;
}
.nasty-item {
text-align: center;
background : lightgray;
position : relative;
top : 45%;
} <div ng-controller="AppController" class="drop-zone" nv-file-over nv-file-drop="" uploader="uploader">
<div class="nasty-item"><span>
Drag file along this element
<br>
(accelerate near the left/right boder)
</span></div>
</div> then, if user moves file out of |
Maybe we should allow child element to trigger onDragLeave (#231) ?
fixed #237 |
This issue is still happening, go to example pages then drag a file over/out the window. Tested on Mac OSX 10.10.5 |
I have the same issue, and this is my workaround. element.on('dragleave', function () {
$(this).removeClass('file-over-now-class');
}); |
+1 even exists in example link |
+1 same here. On my page and on example link. tested on chrome and firefox. Both with same issue. The class only get removed if the file is added to queue. But if i hover the file on the drop zone and leave without adding the file, the class will stay applied. |
Just to add to @chaim-kedem's workaround, if you have child inside the element, you should add |
A simple decorator to the (function () {
'use strict';
appModule.config(function ($provide) {
$provide.decorator('nvFileOverDirective', function ($delegate) {
var directive = $delegate[0],
link = directive.link;
directive.compile = function () {
return function (scope, element, attrs) {
var overClass = attrs.overClass || 'nv-file-over';
link.apply(this, arguments);
element.on('dragleave', function () {
element.removeClass(overClass);
});
};
};
return $delegate;
});
});
})(); Thanks @chaim-kedem for the workaround and @thijsw for the hint. |
In addition to the fix proposed by @chaim-kedem: the fix shouldn't depend on jQuery because you could just use element.on('dragleave', function () {
element.removeClass('file-over-now-class');
}); |
Nothing here has really worked flawlessly for me yet..... Can we get a patch that handles drag leave ?? |
Hello ?? can anyone commit a fix for that ? |
The problem still happening in version 2.2.0, you can check in the sample pages. When you get out from drop zone the over-class remains. |
+1 |
2 similar comments
+1 |
+1 |
This makes the target page not that bad at least. |
Seems to be this line on line no. 1706 of angular-file-upload.js I wonder why it's there... if (event.currentTarget === this.element[0]) return; |
This line appears to be added for a flickering issue for Chrome which I'd imagine could have been solved with CSS alone. I think it needs to take into account whether the nv-file-over directive is applied to the same element as the nv-file-drop so actually changing this to a !== seems to make more sense and is the fix I've applied. |
Does this issue still exist? |
Still not working in 2.5.0 |
Just as subj. I'm on
OS X 10.9 Chrome 37.0.2062.94
,The text was updated successfully, but these errors were encountered: