Skip to main content

Search and Top Navigation

#8060 closed bug (notabug)

Opened January 26, 2012 09:50AM UTC

Closed November 20, 2012 03:13AM UTC

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

Attachments (0)
Change History (4)

Changed January 26, 2012 10:37AM UTC by nhatcher comment:1

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

milestone: 1.9.02.0.0

Changed October 29, 2012 04:45AM UTC by mikesherov comment:3

keywords: → haspatch
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/

Changed November 20, 2012 03:13AM UTC by mikesherov comment:4

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".