Opened 8 years ago

Last modified 7 years ago

#8046 open bug

Droppable: does not get deactivated if the drop event modifies the element so it no longer passes the "accept" option

Reported by: imthehell Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.droppable Version: 1.8.17
Keywords: Cc:
Blocked by: Blocking:

Description

After the drop function is executed, if the accept function of the object no longer return true (because the drop function has changed some paramenters of the dragged object like class ecc.) the object is not deactivated. The problem is this "if":

 if (!this.options.disabled && this.visible && '''this.accept.call(this.element[0], (draggable.currentItem || draggable.element)))''' {
                    this.isout = 1; this.isover = 0;
                    this._deactivate.call(this, event);
                }

the only objects that will be deactivated are those whose the accept function return true. If the accept function no longer return true they remain activated. It should, however, disable all objects in all cases.

Change History (4)

comment:1 Changed 8 years ago by Scott González

#8047 is a duplicate of this ticket.

comment:2 Changed 8 years ago by Scott González

Component: ui.coreui.droppable

comment:3 Changed 7 years ago by Scott González

Milestone: 1.9.02.0.0

comment:4 Changed 7 years ago by mikesherov

Status: newopen
Summary: Object is not deactivateDroppable: does not get deactivated if the drop event modifies the element so it no longer passes the "accept" option

Thanks for contributing! Unfortunately, the accept function needs to return true in order for deactivation to occur properly. A workaround you can use would be to setTimeout your changes during the drop so they occur after the "accept" deactivation takes place.

I'll mark this as open for now in case we decide to bake in a fix for this.

Note: See TracTickets for help on using tickets.