x-tag / core

The Heart of X-Tag
http://x-tag.github.io/
Other
1.25k stars 151 forks source link

Render() Recursion Error #182

Closed ghost closed 6 years ago

ghost commented 6 years ago

V2 Build with a recursion error is ==> https://kipomaha.github.io/x-tag-setup/tests/basic/index.html

Tested on multiple browsers including some older fossils but I believe that the Jasmine test I've got built here demonstrates it just fine. The recursion error only occurs when a custom element is inserted in to the dom.

csuwildcat commented 6 years ago

Ok, this is the spec section 2.2 stuff I suspected. Today I talked with a couple Google friends and they said to do in-source testing because it was probably a difference between the parser flow and the dynamically created element flow. I need to move the onConstruct hook out of the constructor and figure something else out if we want to maintain the automatic construction/render part.

csuwildcat commented 6 years ago

Thank you for confirming with the test case!

ghost commented 6 years ago

Your welcome @csuwildcat, I've made a pull request with comments for V2 and a change to the render() method. The change is just a quick fix, I like the behavior though because it allows you to use the auto-render feature and doesn't clear the innerHTML so you can use render multiple templates.

You still get a recursive error whenever you set content with this.innerHTML, so it still is an issue.