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

responsive-windows issue in IE11 and below #95

Open
eddiechihyi opened this issue Nov 1, 2017 · 0 comments
Open

responsive-windows issue in IE11 and below #95

eddiechihyi opened this issue Nov 1, 2017 · 0 comments
Labels

Comments

@eddiechihyi
Copy link

Our project is utilizing the responsive-window feature and it's been working great until we tested in IE. We found that IE11 is throwing below error for any Angular component utilizing responsive-window.

ERROR TypeError: Object doesn't support this action
   "ERROR"
   {
      [functions]: ,
      __proto__: { },
      description: "Object doesn't support this action",
      message: "Object doesn't support this action",
      name: "TypeError",
...
      number: -2146827843,
      stack: "TypeError: Object doesn't support this action
   at registerWindow (eval code:52:17)
   at ResponsiveWindow.prototype.ngOnInit (eval code:13:9)
   at checkAndUpdateDirectiveInline (eval code:10822:9)
   at checkAndUpdateNodeInline (eval code:12244:13)
  ...

It seems IE 11 and below can't handle the new Event() in below methods (I manually commented out that line and the issue went away). After doing some research, I found that this is a known issue and there's a CustomEvent polyfill for that. Can we have a patch for this issue?

https://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work

        this.registerWindow = function (rw) {
            if (rw.name && !_this._windows[rw.name]) {
                _this._windows[rw.name] = rw;
                window.dispatchEvent(new Event('resize'));                
            }
        };
        this.unregisterWindow = function (rw) {
            for (var rwn in _this._windows) {
                if (_this._windows[rwn] === rw)
                    delete (_this._windows[rwn]);
            }
            window.dispatchEvent(new Event('resize'));
        };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants