Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for <dialog[popover]/>. #60

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

geoffrey-eisenbarth
Copy link
Collaborator

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
Copy link
Collaborator Author

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?

@dz4k
Copy link
Collaborator

dz4k commented Aug 23, 2024

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants