Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The "right" way to solve this issue is to disable pointer events on child elements of the drop target (as in @H.D.'s answer). <a href="http://jsfiddle.net/theodorejb/4ZGvv/">Here's a jsFiddle I created which demonstrates this technique</a>. Unfortunately, this doesn't work in versions of Internet Explorer prior to IE11, since they <a href="http://caniuse.com/pointer-events">didn't support pointer events</a>.</p> <p>Luckily, I was able to come up with a workaround which <em>does</em> work in old versions of IE. Basically, it involves identifying and ignoring <code>dragleave</code> events which occur when dragging over child elements. Because the <code>dragenter</code> event is fired on child nodes before the <code>dragleave</code> event on the parent, separate event listeners can be added to each child node which add or remove an "ignore-drag-leave" class from the drop target. Then the drop target's <code>dragleave</code> event listener can simply ignore calls which occur when this class exists. Here's a <a href="http://jsfiddle.net/theodorejb/j2fDt/8/">jsFiddle demonstrating this workaround</a>. It is tested and working in Chrome, Firefox, and IE8+.</p> <p><strong>Update:</strong></p> <p>I created <a href="http://jsfiddle.net/theodorejb/j2fDt/9/">a jsFiddle demonstrating a combined solution</a> using feature detection, where pointer events are used if supported (currently Chrome, Firefox, and IE11), and the browser falls back to adding events to child nodes if pointer event support isn't available (IE8-10).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      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