Opened 7 years ago

Closed 7 years ago

#16597 closed defect (fixed)

dojox/mobile/IconContainer crashes when moving an icon for the second time

Reported by: Eric Durocher Owned by: Eric Durocher
Priority: undecided Milestone: 1.9
Component: DojoX Mobile Version: 1.8.3
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

(This was revealed by changeset [29904/dojo], which apparently makes _Container.addChild less forgiving than it was before.)

When an IconItem is added to an ItemContainer, its associated paneWidget must be added to the ItemContainer's paneContainerWidget. This is currently done in IconItem.startup, which means that if an item is removed and re-added later, the pane will not be re-added since startup is not called again.

This is mainly visible in edit mode, where icons are repeatedly remove/added, and can be reproduced as follows:

  • launch dojox/mobile/tests/test_IconContainer-editable.html
  • click an item and drag it to another position
  • click an item again => 'Cannot read property 'nodeType' of null'

(This happened to work before [29904/dojo] because addChild used to accept an index higher than the number of children.)

Attachments (1)

16597.patch (2.4 KB) - added by Eric Durocher 7 years ago.
Ensure consistency of pane widgets with items on addChild/removeChild - Eric Durocher (IBM, CCLA)

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Eric Durocher

Attachment: 16597.patch added

Ensure consistency of pane widgets with items on addChild/removeChild - Eric Durocher (IBM, CCLA)

comment:1 Changed 7 years ago by Eric Durocher

Cc: cjolif added
Milestone: tbd1.9

The attached patch modifies IconContainer,addChild so that it now adds the item's pane widget to the pane container when necessary (i.e. when the item was previously removed programatically). Also added a unit test for the removeChild+addChild case.

This fixes the regression reported in ticket:16244#comment:16.

comment:2 Changed 7 years ago by cjolif

Resolution: fixed
Status: newclosed

In [30426]:

fixes #16597. Ensure consistency of pane widgets with items on addChild/removeChild. Thanks Eric Durocher (IBM, CCLA)

Note: See TracTickets for help on using tickets.