Opened 11 years ago
Last modified 10 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 11 years ago by
comment:2 Changed 11 years ago by
Component: | ui.core → ui.droppable |
---|
comment:3 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:4 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | Object is not deactivate → Droppable: 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.
#8047 is a duplicate of this ticket.