I have a jQuery UI draggable and several separately-defined droppables. Because one of the droppables is configured tolerance: 'intersect'
, it's possible for a draggable to be dropped on more than one kind of droppable at the same time.
What's the best way to prevent the unintended droppables from firing? Basically, I'd like to prioritize the droppables so that the droppables with tolerance: 'intersect'
don't get triggered if another droppable was triggered.
Update - More info to clarify things:
All of the droppables are configured
tolerance: 'pointer'
except for one class of droppable withtolerance: 'intersect'
.The reason one class of droppable has
tolerance: 'intersect'
is that the droppables are really narrow, and users have problems finding them withtolerance: 'pointer'
.Moving the droppables further apart isn't an option.
None of the droppables overlap, but the draggable is large enough to overlap a droppable with
tolerance: 'intersect'
while the mouse pointer is over another droppable withtolerance: 'pointer'
. At most two droppables can be triggered at once in this way.The UI is laid out so the user's intentions can be determined by ignoring the
tolerance: 'intersect'
droppable if another droppable has been triggered; i.e. if the user moved the mouse pointer over a droppable withtolerance: 'pointer'
, it's safe to assume that he/she intended to drop it there. Problem is, I can't figure out how to ignore the unwanted droppable.