Skip to main content

Search and Top Navigation

#8046 open bug ()

Opened January 22, 2012 05:24PM UTC

Last modified October 29, 2012 04:39AM UTC

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.

Attachments (0)
Change History (4)

Changed January 22, 2012 07:39PM UTC by scottgonzalez comment:1

#8047 is a duplicate of this ticket.

Changed January 22, 2012 07:40PM UTC by scottgonzalez comment:2

component: ui.coreui.droppable

Changed October 11, 2012 02:49PM UTC by scottgonzalez comment:3

milestone: 1.9.02.0.0

Changed October 29, 2012 04:39AM UTC by mikesherov comment:4

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.