diegoles / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

(goog.ui.Component) addChild(child, true) before decorate(element) #586

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
var parent = new goog.ui.Component();
var child = new goog.ui.Component();

parent.addChild(child, true);
parent.decorate(element);

What is the expected output? What do you see instead?
The child's DOM element should be a child of the parent's DOM element. It is 
not.

This works when calling parent.render() instead of decorate, because the 
underlying implementation calls createDom() if the parent is not currently in 
the document. Doesn't work with decorate because the decorate method does not 
call createDom and actually overrides this.element_ with the decorated element, 
leaving the child detached.

Original issue reported on code.google.com by sc...@langendyk.com on 22 Aug 2013 at 4:08