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

On Firefox, shows this on console : "Error: Failed to execute 'close' on dialog..." #221

Open
Zardoz89 opened this issue May 28, 2021 · 6 comments

Comments

@Zardoz89
Copy link

On Firefox, on the console shows this error every time that I close a dialog :

 Uncaught Error: Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.
    close dialog-polyfill.js:460
@laozhu
Copy link

laozhu commented Jun 28, 2021

The same problem here

@zarahzachz
Copy link

I'm encountering this issue - any movement on it yet?

@Zardoz89
Copy link
Author

Zardoz89 commented Apr 8, 2022

Well... actually you can remove this polyfill on Firefox v >= 98 . It's what I actually I did.

@GrimLink
Copy link

GrimLink commented Apr 8, 2022

Make sure you are using the polyfill only when needed, before registering the dialog, example;

if (typeof HTMLDialogElement !== "function") {
        dialogPolyfill.registerDialog("your-dialog");
}

This should fix any errors you are having.

@Zardoz89
Copy link
Author

Zardoz89 commented Apr 8, 2022

This should fix any errors you are having.

Except if the user it's using a older Firefox release (very strange, but can happen)

@willzoltan
Copy link

This also happens in older versions of Safari, eg 12.1.2. We solved this by wrapping the call in a try ... catch block

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

5 participants