0

I have a simple jsfiddle that won't drop on a droppable DIV, but will drop on a textbox not set as droppable.

Can anyone tell be why the draggable won't drop in the DIV and why it will drop in the text box?

have tried using different selectors, checked that .data('droppable') is true on the DIV (it is) and tried about everything I could find concerning issues with droppable DIVs...alas to no avail.

1 Answers1

1

Using .draggable() directly on inputs isn't advisable as it will cause the fields to become un-editable. I would recommend wrapping your inputs in a <span> or <div> and adding .draggable() to those instad.

Here is your code updated as an example - http://jsfiddle.net/jaredhoyt/FNe6t/1/

jaredhoyt
  • 1,565
  • 8
  • 7
  • Will take your advice, but doesn't solve the problem; still doesn't drop in the div – user1375766 May 04 '12 at 20:20
  • Then I must have misunderstood your question. The example I provided does allow you to grab the span surrounding the input and drop it onto the div which alerts "dropped!". – jaredhoyt May 04 '12 at 20:43
  • Yes, of course you are correct...I was still highlighting the text and trying to drag. Once I grabbed the span it worked. Your post in combination your comment above set me straight; was dynamically adding li items to a list but couldn't drop them anywhere as I attached draggable to 'li' on page load, not at the time of dynamically adding it...thanks – user1375766 May 04 '12 at 21:22