Open Bug 1427644 Opened 6 years ago Updated 2 years ago

DragLeave Event Not Consistently Triggered

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

57 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: duboischris10, Unassigned)

Details

(Keywords: cisco-spark, testcase)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36

Steps to reproduce:

https://jsfiddle.net/chrisadubois/uk5qz0g2/1/

1. Open the JSFiddle
2. Find a file to test dragging with
3. Open the web console
4. try dragging the file into the "Drop" region, notice that drag over is called with a console log
5. Try dragging the file out of the "Drop" region onto the desktop screen, notice that dragLeave is not called (this is intermittent, but happens 75% of the time for me) also, some permission denied error seems to occur in the failure cases

Note: If you swap number 5 for moving the file onto the jsfiddle JS area, you will see the drag leave event called 100% of the time.  Additionally, one can hit the "esc" key to get the drag leave event to pop


Actual results:

notice that dragLeave is not called (this is intermittent, but happens 75% of the time for me) also, some permission denied error seems to occur in the failure cases

 If you swap number 5 for moving the file onto the jsfiddle JS area, you will see the drag leave event called 100% of the time.  Additionally, one can hit the "esc" key to get the drag leave event to pop


Expected results:

The drag leave and drag enter events should be balanced, see this old issue https://bugzilla.mozilla.org/show_bug.cgi?id=919631
or possibly this one
https://bugzilla.mozilla.org/show_bug.cgi?id=1420590
Keywords: cisco-spark
Attached file dragLeave.html
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
20180102110609

The jsfiddle resulted in "dragover_handler is not defined" and "dragleave_handler is not defined", so I transcribed it to a local file.

Out of over 30 attempts, I didn't notice any instance where dragLeave wasn't called. It's just that it mostly resulted in "dragLeave: target.id = undefined" and only seldom "dragLeave: target.id = target". That's probably bug 1420590.
Has Regression Range: --- → irrelevant
Has STR: --- → yes
Component: Untriaged → Drag and Drop
Keywords: testcase
Product: Firefox → Core
(In reply to Gingerbread Man from comment #1)
> I transcribed it to a local file.

When loading the testcase from attachment 8939429 [details] instead, it occasionally results in, "Security Error: Content at https://bug1427644.bmoattachments.org/attachment.cgi?id=8939429 may not load or link to file:///…". It looks like this was already mentioned in bug 1420590, so again I'm not seeing anything new here.
It seems I am unable to reproduce the exact behavior I was seeing... next time I will record a .gif.  For the jsfiddle, the load needs to be changed to no wrap in head to run from js fiddle, but your attachment seems consistent with what I've just checked again. In that case, you are correct, this seems to be a duplicate of bug 1420590.  I'm assuming in this case the onDragLeave function is not actually called all the way through, and errors out in the middle, correct?
Also note it seems to always work when pressing the "esc" key, the target issue does not occur

I want to add some drag-hover effects to dropzones, so I listen 'dragenter' and 'dragleave', while Firefox didn't trigger 'dragleave' consistently: 14 dragenter events triggered but only 3 dragleave events, see console log below.

dragenter 1559
dragleave 1559
dragenter 1560
dragenter 1560
dragenter 1562
dragenter 1563
dragenter 1562
dragenter 1563
dragenter 1562
dragenter 1560
dragenter 1562
dragenter 1560
dragleave 1560
dragenter 1559
dragenter 1560
dragleave 1559
dragenter 1560
drop 1560

Due to this issue I cannot enable drag-hover effects in Firefox, for now.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: