Bug Tracker

Opened 12 years ago

Closed 12 years ago

#1699 closed bug (fixed)

UI/Droppables javascript errors

Reported by: kopytko Owned by: rworth
Priority: undecided Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:

Description

There's an error in UI/Droppables. I'm using Firefox 2.0.0.7 on Windows XP Home SP2. When I try to drag draggable element I get an error: oDrag.helperSize has no properties in ui.droppable.js (line 169)

The same error occurs on IE7.

Attachments (1)

ui-error.JPG (160.2 KB) - added by bartosz.kuzma 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 years ago by paul

Owner: set to rworth

Changed 12 years ago by bartosz.kuzma

Attachment: ui-error.JPG added

comment:2 Changed 12 years ago by bartosz.kuzm

I got the same error when I remove droppable/draggable li element from ul list, and recreate it in other list with the same id and properties. In attachment screenshot form Firebug with error that always occurs immediately before error in ui.droppable.js.

comment:3 Changed 12 years ago by rworth

Status: newassigned

I added a test page: http://dev.jquery.com/view/trunk/plugins/ui/tests/1699.html but am not able to reprodcue the error.

comment:4 Changed 12 years ago by bartosz.kuzm

Well, this function is able to reproduce the error. But it seems that I didn't it properly. I removed element without destroying instance of draggable and droppable connected with this element.

$(document).ready(function(){

$('li').draggable({revert:true}).droppable({

accept: 'li', drop: function(ev, ui) {

var draggable = ui.draggable.element;

Uncomment these lines and the error
will not occur.

$(draggable).draggableInstance().destroy();
$(draggable).droppableInstance().destroy();

$(draggable).remove();

... do some operations ...

recreate element here.

}

});

});

comment:5 Changed 12 years ago by rworth

Resolution: fixed
Status: assignedclosed

Fixed in rev4069. It now works to call $(draggable).remove(); inside the drop callback if you call draggableDestroy() and droppableDestroy() beforehand.

Note: See TracTickets for help on using tickets.