Opened 11 years ago
Closed 10 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:1 Changed 11 years ago by
comment:2 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:3 Changed 10 years ago by
Keywords: | haspatch added |
---|---|
Status: | new → open |
Summary: | over event is not fired correctly → Droppable: 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 10 years ago by
Resolution: | → notabug |
---|---|
Status: | open → closed |
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".
Pull request:
https://github.com/jquery/jquery-ui/pull/583