missing icon indicating copy to clipboard operation
missing copied to clipboard

Add support for <dialog[popover]/>.

Open geoffrey-eisenbarth opened this issue 1 year ago • 2 comments

The Popover API can be used to toggle <dialog> elements without JS (which mdn says is perfectly valid).

Since the Popover API doesn't use the [open] attribute, the result when using missing.css is that the dialogs appear always open. This PR aims to address that.

geoffrey-eisenbarth avatar Aug 19 '24 16:08 geoffrey-eisenbarth

While the Popover API is now baseline, I mainly use it for displaying/hiding <dialog> elements without js (which will presumably be supplanted with the Invoker API). Most articles I see discussing the Popover API bemoan it's limited use until anchor positioning becomes more widespread.

Should we add any custom styling to non-dialog elements that use the [popover] attribute?

geoffrey-eisenbarth avatar Aug 21 '24 15:08 geoffrey-eisenbarth

I mainly use it for displaying/hiding

elements without js (which will presumably be supplanted with the Invoker API).

I recently found out a gotcha around that: dialogs that are popover stop being modal -- i.e. they don't block interaction with the rest of the page, etc. I'm not sure how often this behavior is desirable. It might be a good idea to wait for invoketarget to stabilize so we see how it behaves and can decide the best approach for styling (since as far as I understand it should work identically to JS showModal et al).

Should we add any custom styling to non-dialog elements that use the [popover] attribute?

Maybe? but as you mentioned we don't have anchor positioning yet.

dz4k avatar Aug 23 '24 16:08 dz4k

Closing PR bc this actually got absorbed into #127 via 38dca59.

geoffrey-eisenbarth avatar Aug 03 '25 12:08 geoffrey-eisenbarth