Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery UI Droppable: How to make elements more greedy?
    text
    copied!<p>I am having a problem with nested droppable elements using jQuery UI. </p> <p>Here's the background: </p> <p>I have a parent droppable element which has child droppable elements that arranged next to each other. I also have a set of draggable elements to be dragged onto the droppable elements.</p> <pre><code>&lt;div class="droppable container"&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;div class="droppable"&gt; &lt;/div&gt; &lt;/div&gt; &lt;aside&gt; &lt;div class="draggable"&gt;&lt;/div&gt; &lt;div class="draggable"&gt;&lt;/div&gt; &lt;div class="draggable"&gt;&lt;/div&gt; &lt;div class="draggable"&gt;&lt;/div&gt; &lt;/aside&gt; </code></pre> <p>The droppable elements have the <code>greedy</code> property set to <code>true</code>, which should theoretically prevent propagation to parent elements. The problem is that this works inconsistently. Sometimes the parent gets activated along with the child. This seems to happen most when you drag from one child to an adjacent child.</p> <p>Here's a jsfiddle of what I tried. Try dragging the blue squares into the various pink drop-zones. You'll notice sometimes the parent lights up, even though there is no space between the child elements.</p> <p><a href="http://jsfiddle.net/kXnAM/7/" rel="nofollow">http://jsfiddle.net/kXnAM/7/</a></p>
 

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