x-for doesn't work properly on IE11 #1411
Unanswered
carljia999
asked this question in
5. Bugs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The items in don't show up and you can find various "Unhandled promise rejection" errors in dev tools console.
I did some investigation and concluded it's related to template polyfill that's required on IE11, 2 problems were found,
- template.content = contentDoc.createDocumentFragment();
+ template.content = document.createDocumentFragment();
var child;
while ((child = template.firstChild)) {
capturedAppendChild.call(template.content, child);
By default (without defining window.deferLoadingAlpine ) alpinejs initializes before template polyfill bootstrap runs which is wrapped in DOMContentLoaded event handler, thus alpinejs is accessing template object before it's "polyfilled", please refer to the template polyfill doc.
https://github.com/webcomponents/polyfills/tree/master/packages/template#known-limitations
I fixed my application with this
window.deferLoadingAlpine = function(callback) { document.addEventListener('DOMContentLoaded', callback); }
I report this problem in the hope that you might have a better solution.
Thanks for you great work on alpine.
Beta Was this translation helpful? Give feedback.
All reactions