Opened 15 years ago
Closed 15 years ago
#3121 closed enhancement (invalid)
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: |
Description
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.
JK
Attachments (1)
Change History (4)
Changed 15 years ago by
Attachment: | ui.droppable.js.patch added |
---|
comment:1 Changed 15 years ago by
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.
JK
comment:2 Changed 15 years ago by
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?
JK
comment:3 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
This belongs to jQuery UI. Please repost this to the UI Bug Tracker. Thanks.
Possible patch for "exclusive" draggable.