Open dlockhart opened 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!
Description
I'm not sure if the polyfill is supposed to work this way, but if you load it after the
DOMContentLoaded
event fires, any templates in the main document are not upgraded. This is because the polyfill is listening for this event, and if it's already fired it won't actually do anything to existing<template>
s.Instead, it could check the
readyState
and execute immediately ifDOMContentLoaded
has already fired.This has come up because the open-wc build tooling loads the web component polyfill asynchronously by appending script elements. That means the polyfill is loaded after
DOMContentLoaded
.Live Demo
I've forked the template and modified it to load the polyfill asynchronously and try to peek at a template element: https://jsbin.com/pexohekaqa/1/edit?html,console
Steps to Reproduce
Example:
<template>
in the bodycontent
property in IE11Expected Results
Template's content is accessible.
Actual Results
Template's content is
undefined
in IE11.Browsers Affected