Opened 14 years ago
Closed 14 years ago
#2621 closed defect (fixed)
DnD operation causes an exception in IE when a DropTarget has been removed
Reported by: | Owned by: | psowden | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | DnD | Version: | 0.4.2rc1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Whenever a DropTarget? disappears from a page (for example after a .setContent("") call on a ContentPane? that previousley had DropTargets? defined), subsequent DnD operations cause IE to raise an execption in dojo.dnd.dragManager.cacheTargetLocations().
proposed fix:
--- ./src/dnd/HtmlDragManager.js.old Tue Mar 20 14:51:47 2007 +++ ./src/dnd/HtmlDragManager.js Tue Mar 20 14:54:26 2007 @@ -178,6 +178,7 @@ this.dropTargetDimensions = []; dojo.lang.forEach(this.dropTargets, function (tempTarget) { var tn = tempTarget.domNode; + if ( tn.parentNode == null ) { return; } if (!tn || !tempTarget.accepts([this.dragSource])) { return; }
maybe add
if ( tn.offsetWidth == 0 ) { return; }
at the same place? This should prevent 'invisible' targets to be added to the array (tested in FF and IE6).
BTW, maybe ContentPane?.setContent() should cleanup DragSources/DropTargets? from the 'old' content - as it does for widgets now.
Attachments (1)
Note: See
TracTickets for help on using
tickets.
Testcase added...