Ticket #4570 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

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>

Attachments

greedyDropBadScope.diff Download (1.2 KB) - added by rbrackett 5 years ago.

Change History

Changed 5 years ago by rbrackett

comment:1 Changed 5 years ago by rbrackett

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.

comment:2 Changed 5 years ago by joern.zaefferer

  • Milestone changed from TBD to 1.8

comment:3 Changed 5 years ago by paul

  • Status changed from new to closed
  • Resolution set to fixed

Fixed it for all constellations, scope accept etc, in r3108 !

Note: See TracTickets for help on using tickets.