Search and Top Navigation
#4570 closed bug (fixed)
Opened June 01, 2009 07:53PM UTC
Closed August 22, 2009 12:26PM UTC
Last modified January 17, 2010 06:09AM UTC
Greedy stops propagation of events even if the draggable is not acceptable or is of a different scope
Reported by: | rbrackett | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8 |
Component: | ui.droppable | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If one droppable that accepts a certain draggable contains a droppable that accepts a different draggable (and does not accept the first draggable) and the inner droppable is greedy, the outer droppable cannot accept any draggables.
This is the case even if the two droppables have different scopes.
I don't know if this is intended behavior, but it at least does not seem to be the optimal behavior. Using scope should at least mitigate the issue if accept does not.
Example case:
<div id="outer_container"><div id="inner_container"></div></div> <script type="text/javascript"> $("#outer_container").droppable({ accept: ".dragType1" }); $("#inner_container").droppable({ accept: ".dragType2", greedy: true }); // OR $("#outer_container").droppable({ accept: ".dragType1", scope: "outer_scope" }); $("#inner_container").droppable({ accept: ".dragType2", scope: "inner_scope", greedy: true }); </script>
I've added a patch that fixes this for the scope option (that is, it checks scope when checking greediness), which is the second example above. Not sure if this should also apply if the two droppables have the same scope, but the inner one does not accept the draggable (first case in example). I imagine fixing that would be much more complex.