UI Droppable bug and fix
UI Droppable bug and fix
Hi all,
I'm new here but using jquery for half a year now and now using the
droppables form the UI and found a bug.
When you use a droppable on a hidden div (or similar element) and then
open the div using show() (or similar function), you will notice that
a draggable will not drop onto the droppable element.
This is caused by not determining dimensions at startdrag on the
draggable element. When this is not done, the droppable element
doesn't know it's size and will tell the draggable wrong.
I fixed this issue by determining the dimensions on a startdrag fired
by the draggable and made a testcase:
Incorrect impelemtation: http://project2.exed.nl/_jquerydroppable/standard.html
Correct implementation: http://project2.exed.nl/_jquerydroppable/
I'm no js-expert so the implementation of the fix can propably be
improved but the idea is pretty straightforward.
Fixes are made in ui.droppable.js @ line: 221, ui.draggable.js @ line
111.
With kind regards,
Erik Wijdemans