Open musale opened 1 year ago
Hello musale, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
Describe the bug When you re-use an
mgt
element with templates in a another component, passing in dynamic values to themgtHtml
orhtml
template literals for it, the values are not rendered. Instead, you getclass$lit$'
type of attributes andlit$972034732349$
type of values. In therenderNode
step of theTemplateHelper
, these values cannot be interpreted and the rendering fails.To Reproduce Steps to reproduce the behavior:
Change the
render
code for any component to this:I used
mgt-tasks
.Load the component in the storybook or web server.
View that there are no people and the
no-data
template is rendered.The template renders the concrete values and leaves out the dynamic ones.
Expected behavior Any mgt element used inside another mgt element should render correctly without any errors. If you hard-code the values it works correctly.
But that isn't going to be useful in localization instances or dynamic rendering of specific elements.
Screenshots
Logging in the
TemplateHelper
methods (renderNode` shows the following error:The rendered template on the DOM looks like this:
Environment (please complete the following information):
Additional context I dug around and found out I can render the strings passed to their values in the
mgtHtml
template tag helper. However, that with render all the elements and it does a bad job for objects passed. However, at that level we have the values of the passed in strings. This bug was discovered working on #2150 where I usemgt-people
insidemgt-tasks
and I render an icon alongside theAssign
string if there are no people assigned to a task.