Skip to main content

Bug Tracker

Side navigation

#3121 closed enhancement (invalid)

Opened July 02, 2008 04:31PM UTC

Closed July 07, 2008 11:40PM UTC

Need an option for an "exclusive" draggable

Reported by: jeffkretz Owned by: stefan
Priority: critical Milestone: 1.3
Component: interface Version: 1.2.6
Keywords: draggable Cc:
Blocked by: Blocking:

I'm building a page manager for a CMS using 1.2.6 and the latest UI draggable/droppable.

I have a problem whereby the draggable element sometimes overlaps two drop zones at the same time, thus firing the drop event twice.

My thought was to have a property on the draggable called "exclusive". If the draggable was found to be validly over one drop zone, then it would return false for intersecting any other drop zones.

I've spent the last day trying modifications to the droppable script so I could propose a complete solution but as yet I haven't been able to come up with anything workable.

Any help on this would be greatly appreciated.


Attachments (1)
  • ui.droppable.js.patch (2.5 KB) - added by jeffkretz July 02, 2008 07:07PM UTC.

    Possible patch for "exclusive" draggable.

Change History (3)

Changed July 02, 2008 07:09PM UTC by jeffkretz comment:1

I just found a possible solution. When the draggable fires the "over" event, record which draggable it is over in the draggable.options.isover property (and remove it on the "out" event).

When testing for intersection both for the drag and the drop event, check to see if it is a non-exclusive, the isover is null, or if the isover matches the current droppable. Otherwise return false for intersection.

I've uploaded a patch for review.


Changed July 02, 2008 11:08PM UTC by jeffkretz comment:2

For what it's worth, this problem is only with the "touch" tolerance. Exclusivity is already built into the pointer and intersection tolerances.

I'd still like to solve the problem for exclusive on the "touch" tolerance, but perhaps this isn't the best way to do it.

What do you think?


Changed July 07, 2008 11:40PM UTC by flesler comment:3

resolution: → invalid
status: newclosed

This belongs to jQuery UI.

Please repost this to the UI Bug Tracker.