Skip to content
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

Library doesn't work in Internet Explorer #17

Open
Pravin-Parkhi opened this issue Oct 5, 2018 · 0 comments
Open

Library doesn't work in Internet Explorer #17

Pravin-Parkhi opened this issue Oct 5, 2018 · 0 comments

Comments

@Pravin-Parkhi
Copy link

Pravin-Parkhi commented Oct 5, 2018

While using demos in Internet Explorer, library throws error Object doesn't support this action. This error caused by below snippet.
scope.dispatchEvent(new CustomEvent('lmddbeforestart', {'bubbles': true})).

Reported error is coming because for IE versions >= 9, custom events must be created using document.createEvent() and then initialized using the initCustomEvent method of the previously created event.

So after doing stackoverflow I found we can fix this issue by adding below pollyfill provided by mozila firefox.

(function () {
  if ( typeof window.CustomEvent === "function" ) return false;
  function CustomEvent ( event, params ) {
    params = params || { bubbles: false, cancelable: false, detail: undefined };
    var evt = document.createEvent( 'CustomEvent' );
    evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
    return evt;
   }
  CustomEvent.prototype = window.Event.prototype;
  window.CustomEvent = CustomEvent;
})();
@Pravin-Parkhi Pravin-Parkhi changed the title Library doesn't work in Internet Explorer Make library work in internet explorer Oct 5, 2018
@Pravin-Parkhi Pravin-Parkhi changed the title Make library work in internet explorer Library doesn't work in Internet Explorer Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant