aurelia / templating

An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.
MIT License
116 stars 104 forks source link

@processContent injecting a template element breaks IE rendering #552

Open arnederuwe opened 7 years ago

arnederuwe commented 7 years ago

I'm submitting a bug report

Current behavior: I recently implemented an approach for hiding the replace-part syntax from our framework's custom controls. @jdanyow pointed me in the right direction here. This works fine in chrome/firefox/edge, but now we're facing issues with a customer still using IE11. The templates simply don't render there.

I was thinking this would be the same issue as #460, but unfortunately the fix provided there didn't work in my case.

You can reproduce this by running the attached project in IE and Chrome. The dropdown is populated in IE, but the content doesn't render. au_template_issue.zip

EisenbergEffect commented 7 years ago

@jdanyow I know you had some improvements to template creation you were working on. Can you test this scenario as well?

TimVevida commented 7 years ago

I'm having the same problem here. The fix in #460 works great for simple templates using if.bind, but replace-part is not handled correctly.

According to the source, replace-part must be on a <template> element, so there is no way around this.

We are starting to feel this issue, could this be resolved any time soon?

StrahilKazlachev commented 7 years ago

@arnederuwe IE is known not to like invalid HTML - you are putting content different from text inside an <option>:

<select>
  <option repeat.for="item of itemsSource">
    <template replaceable part="item-template"></template> <!-- invalid HTML -->
  </option>
</select>

@TimVevida By saying you have the same problem, do you mean you are also adding content different from text into an <option>?

arnederuwe commented 7 years ago

Thanks for the reply @StrahilKazlachev If I understand correctly, this would mean you can't use templates inside of an option tag in IE? While unfortunate, if this is a browser limitation, so be it. I do think however limitations like these should be clearly visible in Aurelia's official docs, perhaps create a section listing IE's limitations?