Open paulroemer opened 6 years ago
Warning (or maybe even throwing) about reattaching should not be triggered in the usual case since it's a completely valid operation to move an element or component from one parent to another. Rather, this special protection logic should only be used in cases with e.g. @Id
when the element will still remain in its original location in the DOM since it's an element that is managed by e.g. Polymer in the browser.
We stumbled over an issue with an UIScope'd component (template + Java companion) that we used in two of our templates (sub-templates and referencing it via @Id). Flow did not warn us that the component was attached twice, so we ended up with a fully rendered component at two different places. BUT
this.$server
was not defined in one of them.It would be nice if Flow could log a fat warning when something like that happens.
After understanding the reason the fix was quite simple. We just changed the scope of the component so that different instances have been registerred in the DOM.