1

I'm trying to fire the "drag" on a draggable() but nothing happens when I drag it? This my code:

  $('.agenda-cloned-object').draggable({
   drag: function( event, ui ) {},
   cursor: "move",
   revert: "invalid",
  });

  $( ".agenda-cloned-object" ).on( "drag", function( event, ui ) { console.log("TEST") } );

Edit: Appearantly the drag event does not work on a cloned draggable, is there any fix for this?

RayShawnOfNapalm
  • 210
  • 6
  • 20

1 Answers1

0

I can see the event being fired in Chrome v60 on OSX: https://jsfiddle.net/tb061q8o/

The class name "clone" implies your original code was more complicated. I encourage you to try and boil the problem down to a minimum possible reproduce and share it in JsFiddle.

Also, you are declaring the event handler twice. You could just do this:

$('.agenda-cloned-object').draggable({
   drag: function( event, ui ) { console.log("TEST") },
   cursor: "move",
   revert: "invalid",
});
Rupert Rawnsley
  • 2,622
  • 1
  • 29
  • 40