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

Firing 'eqResize' event fails in IE11 #53

Closed
filmic opened this issue Aug 12, 2015 · 7 comments
Closed

Firing 'eqResize' event fails in IE11 #53

filmic opened this issue Aug 12, 2015 · 7 comments

Comments

@filmic
Copy link

filmic commented Aug 12, 2015

Execution of line:
eqResizeEvent = new CustomEvent('eqResize', {'detail': eqState});

throws an error in IE11:
SCRIPT445: Object doesn't support this action

I use eq.polyfilled.min.js.

This is due the IE implementation of the CustomEvent - see sindresorhus/devtools-detect#9 (comment)

@filmic
Copy link
Author

filmic commented Aug 12, 2015

This caused by incorrect detection of CustomEvent feature support so the polyfill is not used in IE11.

The generated eq.polyfilled code has check:

if (!'CustomEvent' in window &&

        // In Safari, typeof CustomEvent == 'object' but it otherwise works fine
        (typeof window.CustomEvent === 'function' ||
            (window.CustomEvent.toString().indexOf('CustomEventConstructor') > -1))
    ) {//polyfill}

but it should be:

if (!('CustomEvent' in window &&

        // In Safari, typeof CustomEvent == 'object' but it otherwise works fine
        (typeof window.CustomEvent === 'function' ||
            (window.CustomEvent.toString().indexOf('CustomEventConstructor') > -1))
    )) {//polyfill}

@Snugug
Copy link
Owner

Snugug commented Aug 12, 2015

Merged. Releasing an update soon.

@Snugug Snugug closed this as completed Aug 12, 2015
@lmartins
Copy link

Im using the latest build 1.7.1 and im still getting this error when IE tries do create the eqResize custom event, is this expected behaviour?

@lmartins
Copy link

Btw, the errors im getting happen in IE11, the message is as follows:

SCRIPT445: Object doesn't support this action
File: eq.min.js, Line: 2, Column: 1508

And that refers to:
u = new CustomEvent("eqResize", { detail: a, bubbles: !0 })

Maybe something's still wrong with the polyfill. When using another polyfill such as https://github.com/krambuhl/custom-event-polyfill it does work with any errors.

@Snugug
Copy link
Owner

Snugug commented Aug 27, 2015

Are you using the polyfilled version or not?

On Aug 27, 2015, at 1:56 PM, Luis Martins [email protected] wrote:

Btw, the errors im getting happen in IE11, the message is as follows:

SCRIPT445: Object doesn't support this action
File: eq.min.js, Line: 2, Column: 1508
And that refers to:
u = new CustomEvent("eqResize", { detail: a, bubbles: !0 })


Reply to this email directly or view it on GitHub.

@lmartins
Copy link

So sorry Sam. Im using JSPM and for some reason my usual approach to override the entry point is failing in this case. So yeah, I was loading the non-polyfilled despite asking for it.
Thanks and sorry about that.

@jonscottclark
Copy link

Hey @Snugug, could you include a note about CustomEvent in the polyfills section in the readme?

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

4 participants