title: dragexit vs dragleave - which should be used?
body: <p>The HTML Drag and Drop API defines two very similar events, <code>dragleave</code> and <code>dragexit</code>, which along with <code>dragenter</code> are intended to help track the current drop target.</p>
  
  <p>A quick search didn't turn up any current and clear documentation of the two events, when one should be used over another, and the browser support, so I thought I'd ask here.</p>
  
  <p>I'll share the resources I found so far:</p>
  
  <ul>
  <li>The <a href="https://html.spec.whatwg.org/multipage/interaction.html#dnd" rel="noreferrer">HTML specification</a> has detailed description of when each event is supposed to be fired, but it requires some deciphering.</li>
  <li>The MDN docs (<a href="https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API#Drag_Events" rel="noreferrer">HTML Drag and Drop API</a> and individual <a href="https://developer.mozilla.org/en-US/docs/Web/Events/dragexit" rel="noreferrer">dragexit</a>/<a href="https://developer.mozilla.org/en-US/docs/Web/Events/dragleave" rel="noreferrer">dragleave</a> pages) are not much of a help, saying <em>"The dragexit event is fired when an element is no longer the drag operation's immediate selection target." / "The dragleave event is fired when a dragged element or text selection leaves a valid drop target."</em> and providing no information about browser support for dragexit (as of 2017-03)</li>
  <li><a href="http://help.dottoro.com/ljoiuehq.php" rel="noreferrer">Dottoro's dragexit docs</a> (another of the top Google hits) seems out of date, claiming that "The dragexit event is obsolete in Firefox from version 3.5. Use the ondragleave event instead."</li>
  <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=619703" rel="noreferrer">Mozilla's bug 619703</a> and <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=11568" rel="noreferrer">W3C bug 11568</a> referenced there shed some light on the history of these two events:
  
  <ul>
  <li>Looks like Gecko/Firefox initially implemented <code>dragexit</code> while IE at least implemented <code>dragleave</code>, the major difference being the order of events: <code>dragexit</code> fires before corresponding <code>dragenter</code>, while <code>dragleave</code>, confusingly, fires after.</li>
  <li>The HTML5 spec initially only defined <code>dragleave</code> with IE semantics, but later (~2013) added <code>dragexit</code> with Mozilla's semantics.</li>
  <li>Gecko appears to have implemented <code>dragleave</code> in Firefox 3.5 (2009), originally synonymous with <code>dragexit</code>, but later (4.0, ~2011?) changing it to match the spec.</li>
  <li><a href="http://caniuse.com/#search=drag" rel="noreferrer">caniuse</a> indicates that the HTML DnD API is more-or-less supported across modern browsers, but does not say anything about <code>dragexit</code> specifically</li>
  </ul></li>
  </ul>