dialog-polyfill
dialog-polyfill copied to clipboard
On Firefox, shows this on console : "Error: Failed to execute 'close' on dialog..."
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
The same problem here
I'm encountering this issue - any movement on it yet?
Well... actually you can remove this polyfill on Firefox v >= 98 . It's what I actually I did.
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.
This should fix any errors you are having.
Except if the user it's using a older Firefox release (very strange, but can happen)
This also happens in older versions of Safari, eg 12.1.2. We solved this by wrapping the call in a try ... catch
block