Skip to content
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

File drop area keeps vanishing #202

Closed
Lenbok opened this issue Jul 22, 2013 · 6 comments

Comments

Projects
None yet
4 participants
@Lenbok
Copy link

commented Jul 22, 2013

When I drag a gcode file over the window, initially the dark grey file drop area shows up, but it then vanishes until I wiggle the mouse some more. Happens with both firefox and chrome, on ubuntu 12.04. Octoprint commit
407c61c

@wdl1908

This comment has been minimized.

Copy link

commented Nov 26, 2013

I have the same problem but mine blinks on and off and the file drop only works when the cursor moves and I release the button. When the cursor is stationary and I release the button more often than not the upload does not happen.

Linux, Firefox

@foosel

This comment has been minimized.

Copy link
Owner

commented Mar 3, 2015

Couldn't reproduce at all, might have been fixed though by simply changing around stuff for other things. Please reopen if it still occurs for you.

@foosel foosel closed this Mar 3, 2015

@eyal0

This comment has been minimized.

Copy link
Contributor

commented Apr 13, 2017

I'm seeing this issue, too, on multiple computers. All are Ubuntu Linux using Chrome.

I'll work on it.

@foosel

This comment has been minimized.

Copy link
Owner

commented Apr 13, 2017

@eyal0 hmm, ok, reopening it then. I still haven't been able to reproduce it all, but if you are able to somewhat reliably reproduce it, maybe we can get this narrowed down together!

@foosel foosel reopened this Apr 13, 2017

@eyal0

This comment has been minimized.

Copy link
Contributor

commented Apr 13, 2017

Okay, I'm able to reproduce it and I understand the issue. The problem is in files.js. There is a timer that causes the file upload overlay to disappear after 100ms. Ideally, the dragover event continues to trigger faster than that and there is no problem. But, when the mouse is dragging but not moving, dragover only triggers once every 350ms, according to this webpage.

One solution is to modify the above line from 100 to 400. 400 is safely above 350ms. I tested this on my computer and it works. However, 400ms is slow and the webpage becomes a little clunky.

A better solution is to use dragenter and dragleave. It's tricky because a dragleave event occurs when the overlay appears to so you can't just hook dragleave. You need to make sure that it's dragleave of the most recent dragenter. I'll write a PR for that. In the meanwhile, try changing 100 to 400 and see how you like. If it's good enough for you, okay. If it's too slow then the dragleave solution is more complicated but much nicer.

@eyal0 eyal0 referenced this issue Apr 13, 2017

Closed

Fix dragndrop upload #1867

10 of 10 tasks complete
@foosel

This comment has been minimized.

Copy link
Owner

commented Apr 19, 2017

Fixed thanks to PR #1867 by @eyal0 👍 Merged to maintenance, soon devel, will be part of the 1.3.3 release.

@foosel foosel added this to the 1.3.3 milestone Apr 19, 2017

@foosel foosel closed this in 358a252 May 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.