Open mitranim opened 2 years ago
I second this. However, I think the polyfill should define window.HTMLDialogElement accordingly by itself, not just export it. I ran into this exact problem and a polyfill should polyfill the missing functionality - HTMLDialogElement is part of this missing functionality.
Note that this is a somewhat rare use-case right now, since Safari does not support it (requires a tiny polyfill). But extending built-in elements is extremely useful in a certain web programming style and could spread ...
"a somewhat rare use-case right now" The GitHub web interface uses it now, and the user navigation will now break on any web browser that doesn't have HTMLDialogElement natively (most worringly, Firefox versions below 98).
First off, thanks for the polyfill. It seems to work.
Motive: my app is organized around custom elements, many of which are instantiated directly with
new
. I'm not concerned with tag name compatibility such as<dialog is=some-dialog>
vs<some-dialog>
. What's important is simply having the base class available.I hacked together the following and it seems to work, but having it provided by the library would be better. Hopefully without increasing the size of the polyfill.