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
Closed

File drop area keeps vanishing #202

Lenbok opened this issue Jul 22, 2013 · 6 comments
Labels
done Done but not yet released

Comments

@Lenbok
Copy link

Lenbok 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
Copy link

wdl1908 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
Copy link
Member

foosel 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 as completed Mar 3, 2015
@eyal0
Copy link
Contributor

eyal0 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
Copy link
Member

foosel 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
Copy link
Contributor

eyal0 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 mentioned this issue Apr 13, 2017
10 tasks
@foosel
Copy link
Member

foosel 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 the done Done but not yet released label Apr 19, 2017
@foosel foosel added this to the 1.3.3 milestone Apr 19, 2017
@foosel foosel closed this as completed in 358a252 May 31, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
done Done but not yet released
Projects
None yet
Development

No branches or pull requests

4 participants