-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken IE11 compatibility (Babel?) #235
Comments
Hey, did you tried the simplelightbox/dist/simple-lightbox.legacy.min.js version? This is for old Browsers without es6 features. Best regards |
Yes, meanwhile I've noticed that file, but I use Webpack with my own Babel config and polyfills are based on |
However, looking at your import "core-js/stable";
import "regenerator-runtime/runtime"; and AFAIK this means that Babel will import ALL polyfills, not just those that are really needed for your plugin. This is why the bundled |
Finally, I've succeeded to make it work on IE11 with my own Babel config and compile this plugin into my vendors.js. However, a little modification is needed in the code of So my suggested fix in createNewEvent(eventName) {
let event;
if (typeof(Event) === 'function') {
// the standard way
event = new Event(eventName);
} else {
// the IE way
event = document.createEvent('Event');
event.initEvent(eventName, true, true);
}
return event;
} then replace all the element.dispatchEvent(this.createNewEvent('close.simplelightbox')); I've tested and it works! Alternative solution: |
Ok, I fix it in another way. If I only use the babelrc every file is more that 100kb bigger. New version comming soon. |
Hi @andreknieriem ! Thank you for this great plugin!
The list of features mentions:
currently, for IE11 this is not true. It fails even on the demo site with error:
Running it through my project's Babel config (with Object assign polyfill) this error disappears, but another one comes up:
at this line of the code:
Maybe this issue @
core-js
could be related (not sure).The text was updated successfully, but these errors were encountered: