Opened 8 years ago

Closed 7 years ago

#8060 closed bug (notabug)

Droppable: over event is not fired correctly when a non accepted draggable is dropped in drop area

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

Description

(Better described in http://jsfiddle.net/LWeeA/1/)

Take three elements. One droppable (Drop) and two draggable (Drag1 and Drag2)

Drop accepts Drag1 but not Drag2.

then drop Drag1 and Drag2 in Drop.

Move around Drag1.

PROBLEM: over is not fired.

Possible solution:

In the drop function change:

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);
}

to this:

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


It affects all browsers and all versions of jQuery ui

Change History (4)

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

Milestone: 1.9.02.0.0

comment:3 Changed 7 years ago by mikesherov

Keywords: haspatch added
Status: newopen
Summary: over event is not fired correctlyDroppable: over event is not fired correctly when a non accepted draggable is dropped in drop area

confirmed on latest using directions described in the fiddle: http://jsfiddle.net/WRyQg/

comment:4 Changed 7 years ago by mikesherov

Resolution: notabug
Status: openclosed

Thanks again for contributing! Actually, this works as expected per the documentation. From http://api.jqueryui.com/droppable/#event-over: "Triggered when an accepted draggable is dragged over the droppable (based on the tolerance option)." For that reason, I'm going to close this as "not a bug".

Note: See TracTickets for help on using tickets.