Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#5638 closed defect (duplicate)

dijit.layout.ContentPane._checkIfSingleChild() returns false for single widget child and one or more plain HTML children...

Reported by: [email protected] Owned by: mumme
Priority: high Milestone: 1.2
Component: Dijit Version: 1.0
Keywords: dijit.layout.ContentPane _checkIfSingleChild single child isContainer Cc:
Blocked By: Blocking:


The dijit.layout.ContentPane._checkIfSingleChild() API's doc says that "Test if we have exactly one widget as a child...". However, if we put a single widget and one or more normal HTML elements inside a ContentPane, this API returns false. If the widget is the only child of the ContentPane, then it correctly returns true. I believe the culprit is an unnecessary condition in line no. 113:

Is: "if(childNodes.length == 1 && childWidgets.length == 1){"

Should be: "if(childWidgets.length == 1){"

The "childNodes.length == 1" check is faulty since it goes agains the API contract that it should check only for the child widgets count and not for plain HTML child nodes.

Attachments (1)

test.html (1.8 KB) - added by guest 14 years ago.
Attached test case…

Download all attachments as: .zip

Change History (6)

Changed 14 years ago by guest

Attachment: test.html added

Attached test case...

comment:1 Changed 14 years ago by Adam Peller

Owner: changed from anonymous to mumme

comment:2 Changed 14 years ago by bill

Cc: [email protected] removed
Component: GeneralDijit
Reporter: changed from guest to [email protected]

Hi, we could "fix" this by just changing the API doc for that function but I'm guessing that wouldn't satisfy your requirements. What are you doing (why do you need to stick normal HTML elements in there along with the widget)?

comment:3 Changed 14 years ago by bill

Milestone: 2.0
Priority: highnormal
Resolution: duplicate
severity: majorminor
Status: newclosed

Unclear why this is even an issue, but will resolve as part of work for #5676.

comment:4 Changed 14 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:5 Changed 13 years ago by bill

Milestone: 1.31.2
Note: See TracTickets for help on using tickets.