Skip to main content

Bug Tracker

Side navigation

#1547 closed bug (fixed)

Opened August 28, 2007 04:37PM UTC

Closed December 07, 2007 01:52AM UTC

Last modified November 06, 2013 05:57PM UTC

drop callback function runs twice in jQueryUI

Reported by: pragueexpat Owned by: rworth
Priority: major Milestone:
Component: ui Version: 1.1.3
Keywords: drop callback twice Cc:
Blocked by: Blocking:

I have one draggable div and one droppable div. Each is nested in its own absolutely positioned parent div (see file source below). The droppable div has a callback function. The problem is that the callback is running twice. If the droppable div is not nested in the parent the callback runs correctly (once). If the parent is not absolutely positioned, the callback also runs correctly. The problem occurs in IE, Firefox and Opera (no others tested). Greedy parameter makes no difference. draggable.js, droppable.js and mouse.js were downloaded from svn on August 28, 2007.

HTML file: (Firebug console.log will output div id each time callback runs)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
		<script type="text/javascript" src="/lib/jquery/jquery-"></script>
		<script type="text/javascript" src="/lib/jqueryui/ui.mouse.js"></script>
		<script type="text/javascript" src="/lib/jqueryui/ui.draggable.js"></script>
		<script type="text/javascript" src="/lib/jqueryui/ui.droppable.js"></script>
		<script type="text/javascript" src="/lib/jquerydimensions/jquery.dimensions.js"></script>
		<style type="text/css">
				border:1px solid blue;
				border:1px solid blue;
				border:1px dashed red;
	<div id="textInput1_container" class="dragdiv">
		Enter text: <input type="text" id="textInput1" name="textInput1" size="40" />
		<div id="drag_textInput1" class="dd drag">Drag</div>
	<div id="textInput2_container" class="dragdiv">
		Enter text: <input type="text" id="textInput2" name="textInput2" size="40" />
		<div id="drop_textInput2" class="dd drop">Drop</div>

<script type="text/javascript">


createDropTarget = function(jObj){

createDragTarget = function(jObj){


Attachments (0)
Change History (7)

Changed August 30, 2007 02:05PM UTC by paul comment:1

owner: paulrworth

Changed September 19, 2007 02:37AM UTC by rworth comment:2

It seems one of the drops is coming from the element, and the other from the cursor. If you drop the draggable but the cursor is not over the droppable, only one drop is called.

Changed December 02, 2007 12:43PM UTC by nadia comment:3

I'm having exactly the same problem. I hope a fix is soon to come.


Changed December 02, 2007 04:27PM UTC by bstar comment:4

I had the same problem. It seems that a second call is made via the mouseup event.

As a quick fix I added this code to the

function of the file
: (after line line 126, release 1.0)

  if ( e.type!="dragstop" ) return;  // don't handle events called via mouseup. TEMP FIX

Changed December 07, 2007 01:52AM UTC by rworth comment:5

resolution: → fixed
status: newclosed

Fixed in rev4063

Changed November 06, 2013 05:55PM UTC by anonymous comment:6

Replying to [comment:5 rworth]:

Fixed in rev4063

The problem still occurs with JQuery UI get from

When changing positionning of parent element to absolute drop event called twice.the problem does not occurs with relative positionning.

Best Regards


Changed November 06, 2013 05:57PM UTC by anonymous comment:7


I Have forgotten to precise the version of the browser :

Chrome Version 30.0.1599.101 m