Bug Tracker

Modify

Ticket #3121 (closed enhancement: invalid)

Opened 5 years ago

Last modified 5 years ago

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

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

ui.droppable.js.patch Download (2.5 KB) - added by jeffkretz 5 years ago.
Possible patch for "exclusive" draggable.

Change History

Changed 5 years ago by jeffkretz

Possible patch for "exclusive" draggable.

comment:1 Changed 5 years ago by jeffkretz

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 5 years ago by jeffkretz

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 5 years ago by flesler

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

This belongs to jQuery UI. Please repost this to the  UI Bug Tracker. Thanks.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.