tldr; I’m just going to say right now that the dialog element and its polyfill are not suitable for use in production. And it’s been that way since the dialog’s earliest implementation in Chrome, six-ish years ago.
In our previous post A introduction to Web Components we learned the basics of the APIs that when used together can create a compelling and reusable way to make UI components. We learned Web Components communicate primarily via properties and events. Web Components can also use the Shadow DOM API to create template and CSS encapsulation. In this post we are going to look into a project ran by Polymer called lit-html.
HTML 5.2 has introduced a new <dialog> element for native modal dialog boxes. At first glance, it seems fairly straightforward (and it is), but as I’ve been playing around with it, I’ve found it has some nice features that might be easy to miss.