open and showModal are missing for dialog
I saw that diallog had an open row in it's attribute row type. However, I don't see any functions to create the open attribute for the dialog element.
Also, showModal would be a great addition, although it is neither a property nor an attribute, as per the spec, but it might not be a bad idea to add it as a helper prop where the VDom can call .showModal() and .close() on the element as the prop is added/removed.
@jquesada2016 can you point to the relevant documentation?
Is this good enough?
I agree that being able to control this via property would be much more pleasant to deal with, I think it'll need special support in Prop in halogen-vdom most likely. I don't think we'd need a separate showDialog though, it could use the open property for that.
I believe we would definitely need a showModal property, because open and showModal have very different behaviors. open shows the modal, but does not render, by default, an overlay, and elements underneath the modal are still interactive. Whereas showModal opens the dialog in modal mode, showing an overlay by default, and prevents elements under the dialog from being interacted with.
Ah whoops, of course. What I meant then is I think open would also need special handling as I think you have to call show rather than just setting it.
Yes! Exactly right. Setting the open attribute only works when initially rendering the HTML in SSR. After the page has loaded, you need to call el.show() or el.showModal(), and el.close() to close it.