Ticket #5638 (closed defect: duplicate)

Opened 5 months ago

Last modified 5 months ago

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.

Attachments

test.html (1.8 kB) - added by guest 5 months ago.
Attached test case…

Change History

Changed 5 months ago by guest

Attached test case...

Changed 5 months ago by peller

  • owner changed from anonymous to mumme

Changed 5 months ago by bill

  • cc vikas.sasidharan@… removed
  • component changed from General to Dijit
  • reporter changed from guest to vikas.sasidharan@tavant.com

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)?

Changed 5 months ago by bill

  • priority changed from high to normal
  • status changed from new to closed
  • resolution set to duplicate
  • severity changed from major to minor
  • milestone set to 2.0

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

Changed 5 months ago by alex

  • milestone changed from 2.0 to 1.3

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.