metal.js icon indicating copy to clipboard operation
metal.js copied to clipboard

Metal Soy Component Breaks When More Than One Html Element Is Present in It's Root

Open kresimir-coko opened this issue 6 years ago • 3 comments

{template .render}
  <label>
  <input>
{/template}

The example above will cause issues while the one below won't.

It should be documented (and it would be awesome if there would be a compile error) that trying to render a template with more than 1 HTML element in its root isn't intended.

{template .render}
  <div class="container">
    <label>
    <input>
  </div>
{/template}

kresimir-coko avatar Feb 15 '18 13:02 kresimir-coko

Unfortunately this is an issue with Incremental DOM. Not sure if metal can catch and trap the issue.

yuchi avatar Feb 16 '18 11:02 yuchi

We should at least have it documented somewhere, perhaps https://github.com/liferay/soy-cheat-sheet or https://github.com/jbalsas/liferay-metal-soy-guidelines

kresimir-coko avatar Feb 16 '18 11:02 kresimir-coko

Hey @kresimir-coko , the repos that you are shown is outdated. We're now working with the following documentation: https://hosting-liferayfrontendguidelines.wedeploy.io/soy/

diegonvs avatar Feb 16 '18 15:02 diegonvs