Ticket #5638 (closed defect: duplicate)
dijit.layout.ContentPane._checkIfSingleChild() returns false for single widget child and one or more plain HTML children...
| Reported by: | vikas.sasidharan@… | Owned by: | mumme |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3 |
| Component: | Dijit | Version: | 1.0 |
| Severity: | minor | Keywords: | dijit.layout.ContentPane _checkIfSingleChild single child isContainer |
| Cc: |
Description
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.