Note that there are some explanatory texts on larger screens.

plurals
  1. POFirefox firing dragleave when dragging over text
    primarykey
    data
    text
    <p>I'm attempting to track a dragenter/leave for the entire screen, which is so far working fine in Chrome/Safari, courtesy of the draghover plugin from <a href="https://stackoverflow.com/a/10310815/698289">https://stackoverflow.com/a/10310815/698289</a> as in:</p> <pre><code>$.fn.draghover = function(options) { return this.each(function() { var collection = $(), self = $(this); self.on('dragenter', function(e) { if (collection.size() === 0) { self.trigger('draghoverstart'); } collection = collection.add(e.target); }); self.on('dragleave drop', function(e) { // timeout is needed because Firefox 3.6 fires the dragleave event on // the previous element before firing dragenter on the next one setTimeout( function() { collection = collection.not(e.target); if (collection.size() === 0) { self.trigger('draghoverend'); } }, 1); }); }); }; function setText(text) { $('p.target').text(text); } $(document).ready(function() { $(window).draghover().on({ 'draghoverstart': function() { setText('enter'); }, 'draghoverend': function() { setText('leave'); } }); }); </code></pre> <p>However Firefox is still giving me problems when I drag over text items, here's a fiddle to demonstrate: <a href="http://jsfiddle.net/tusRy/6/" rel="nofollow noreferrer">http://jsfiddle.net/tusRy/6/</a></p> <p>Is this a Firefox bug or can this be tamed with JS? Or is there a more robust method for performing all of this?</p> <p>Thanks!</p> <p><em>UPDATE</em>: Updated fiddle to <a href="http://jsfiddle.net/tusRy/6/" rel="nofollow noreferrer">http://jsfiddle.net/tusRy/6/</a> to reduce clutter a bit. To explain the expected behavior of the fiddle:</p> <ul> <li>Drag a file into the window and p.target should be "ENTER" colored yellow.</li> <li>Drag a file out of the window and p.target should be "LEAVE" colored red.</li> <li>Drop a file in the window and p.target should be "LEAVE" colored red.</li> </ul> <p>In firefox, the LEAVE event is triggered when you drag the file over text.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload