GoogleChrome / dialog-polyfill

Polyfill for the HTML dialog element
BSD 3-Clause "New" or "Revised" License
2.45k stars 245 forks source link

Issues with demos in IE 10 #147

Closed alexander-sheehan closed 4 years ago

alexander-sheehan commented 7 years ago

I'm trying to run the demos provided at https://demo.agektmr.com/dialog/ in IE 10 and am getting the prompt: "Your browser doesn't seem to support dialog element yet. This demo is running in polyfill mode." However, none of the demo's seem to be functional. Buttons that are supposed to be on the dialog box are being displayed by default and all buttons don't seem to have any function.

samthor commented 7 years ago

Is there any interesting console etc output? The demo page should be inserting the relevant script and CSS (can you check actually? The Angular code in main.js should do it—although I do wonder whether Angular supports IE10).

We can test in IE10/9, but it's a struggle.

alexander-sheehan commented 7 years ago
screen shot 2017-07-07 at 11 20 22 am screen shot 2017-07-07 at 11 20 49 am

These are two screen shots of two particular demos on the page, but all of demos are failing

screen shot 2017-07-07 at 11 19 38 am

This is the console output upon loading the page.

Edit: these particular outcomes have be recreated on multiple different machines, all on IE 10

Edit 2:

screen shot 2017-07-07 at 11 32 39 am

if it helps, here is the style of one of the dialog elements

samthor commented 7 years ago

This is a problem with the demo site, not with dialog. We probably won't fix it, but if it's important I can come up with a simpler one.

If you have any problems with using dialog on IE9/10 please file new bugs.

NaggingDaivy commented 6 years ago

Hello, I am using this polyfill in my application and it does not work with IE9 or IE10 or IE11. I am getting the same errors as in the demos. However, the demo work for IE11. So, I suppose that support for IE9,10 and 11 is not available?

sntran commented 6 years ago

This is the error I see in IE10:

"In strict mode, function declarations cannot be nested inside a statement or block. They may only appear at the top level or directly inside a function body. "

This comes from this code block of version 0.4.9:

    var nativeFormSubmit = HTMLFormElement.prototype.submit;
    function replacementFormSubmit() {
      if (!isFormMethodDialog(this)) {
        return nativeFormSubmit.call(this);
      }
      var dialog = findNearestDialog(this);
      dialog && dialog.close();
    }

This is fixed on master (through PR #160), but has not been published to NPM yet.

samthor commented 6 years ago

I've published 0.4.10 to fix this.

samthor commented 4 years ago

I've published new demos however they use modern JS/CSS and probably won't work in IE10.