Closed brandonpayton closed 7 years ago
Hmm I'll need to think about it a bit.
Fixed in https://github.com/crysalead-js/dom-layer/commit/88ff26d5bc82730c495c96dcf679261263cf54ad
The 'created'
hook is triggered while the dom element is created while the 'inserted'
is triggered while the dom element has been actually inserted in the DOM.
Tag's
created
hook is called inconsistently relative to when its element is inserted in the DOM.Tag#render
, thecreated
hook is called after the node's element is inserted in the DOM, but whenTag#render
appends itself to a document fragment,created
is called before the node is added to the DOM document bytree/patch
.created
hooks may need to do things like take layout measurements which require being part of the document flow.I don't have a strong idea how this should be fixed in the current implementation. Since you likely want to do child insertions before the parent is added to the DOM, I believe you will have to walk the tree to render, insert the parent in the DOM, and then walk the tree again to fire
created
hooks.