Replies: 1 comment 6 replies
-
Hi, Thanks for the clear explanation. We should definitely support Angular and the likes 👍 I think your proposed example (waiting for We could do this:
Please feel free to make an issue (bug report) referring to this discussion. We could pick this up next week. In the meantime you could work around it via props(but text only) if this problem blocks you atm, via |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
I make this post hoping it will help me to define if a bug should be submitted or not.
I encounter a problem with lion inputs when using them in angular which, after much debugging, i can't resolve on my part.
I finally understood that there is a problem/incompatibility with the lightdom approch and imperative instanciation of components. This problem may not be limited to angular, i even think that it work specifically in lit-element because of the way lit element render (single pass render of the dom and filling the gaps after).
The problem (using the officials exemples):
This code
Will produce something like at runtime this in lit-element (i ommited a lot of attributes for lisibility)
But in angular it render like this (notice the 2 help-text slotted element):
This is because the above html is compiled in angular to something like this:
During execution of this code, then executing 'THE line', connectedCallback() lifecycle method is called.
In this method, SlotMixin will check if an element is present in the slot and if not will append one creating the lightdom.
Because the child is not yet created an element will be slotted.
More over other mixins/components will check their dom during connectedCallback() to get reference to slotted elements (like lion-validation-feedback)
This is a major problem for angular but it may be for React too and for any framework which doesn't render all the node in single passe.
I think doing those dom queries asynchronously in connectedCallback should solve the problem but it mean a lot of changes in the code.
But I not even sure it will solve the problem because I can't make sure angular/react will not split the render in multiple passes but I can have hope :)
It may exist a better solution because i am not understanding all the architecture of lion elements.
Beta Was this translation helpful? Give feedback.
All reactions