Skip to main content

Search and Top Navigation

#3802 closed bug (fixed)

Opened January 12, 2009 08:24AM UTC

Closed March 16, 2009 08:44AM UTC

Last modified January 18, 2012 01:33AM UTC

Draggable: Drag callback not called when using Jquery 1.3b2

Reported by: yo-han Owned by:
Priority: minor Milestone: 1.7
Component: ui.draggable Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

When I use Jquery-UI with the Jquery 1.3b2 the drag callback is not called. In the code below the alert "hello world" never shows up.

$j('#dragger').draggable({cursor:'move',containment:'#div',appendTo:'#div',drag:function(e,ui){ alert('hello world'); }})

Attachments (0)
Change History (5)

Changed January 20, 2009 01:50PM UTC by PERECil comment:1

I've successfully reproduced the bug with thoses conditions:

  • final release of Jquery 1.3
  • 1.6RC4 of Jquery UI

The bug could be reproduced with the start, stop and drag methods.

Changed February 04, 2009 01:28PM UTC by moiseev comment:2

Adding the following code to the ui.draggable.js:

if(this.options[n]) {
         this.options[n].apply(this.element, [e, this.uiHash()]);

inside propagate method right after '$, n, [e, this.uiHash()]);' seems to work fine for me.

Changed February 04, 2009 05:23PM UTC by moiseev comment:3

As far as I understood digging deep into the code - the problem is that the call to 'this.element.triggerHandler' does not use 'this.options[n]' being passed in a last argument as an event handler but only as an event name (see jQuery.triggerHandler and jQuery.trigger). Correct me if I'm wrong.

I was also able to get it to work updating the 'init' method in ui.draggable.js appending the following lines to it:

      if(o['start']) this.element.bind('dragstart.'+this.widgetName, o['start']);
      if(o['stop']) this.element.bind('dragstop.'+this.widgetName, o['stop']);
      if(o['drag']) this.element.bind('drag.'+this.widgetName, o['drag']);

BUT! In this case it works significantly slower.

PS: The same problem with ui.resizable.js.

Changed March 16, 2009 08:44AM UTC by paul comment:4

resolution: → fixed
status: newclosed

Changed January 18, 2012 01:33AM UTC by scottgonzalez comment:5

milestone: 1.later1.7