Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Discussion] Can popover api be utilized in a11y-dialog? #667

Open
zerdox-scalr opened this issue May 19, 2024 · 2 comments
Open

[Discussion] Can popover api be utilized in a11y-dialog? #667

zerdox-scalr opened this issue May 19, 2024 · 2 comments

Comments

@zerdox-scalr
Copy link

Why a11y-dialog

Building interactions that rely on events. The native <dialog> element supports cancel and close events, but their behaviors aren’t reliable. The <dialog> does not support an open event at all.

https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using#dismissing_popovers_automatically_via_a_timer

Maybe we can make a11y-dialog even more lightweight by adding opt-in to utilize popover api? A popover api plugin for a11y-dialog 🤔

@KittyGiraudel
Copy link
Owner

Probably worth getting @hidde’s opinion on whether it‘s worth it / a good idea as he is the person I can think of who knows most about the popover API.

@hidde
Copy link

hidde commented May 22, 2024

It seems useful to me to include it optionally:

  • to allow folks to make a dialog that is top layer (by setting popover); this is especially helpful for folks that may have <dialog>s that are shown with showModal() in their applications. Such dialogs will be in the top layer, so any a11y-dialog-created dialog that wants to participate in the same stacking context would need to be in the top layer too (and therefore need a popover attribute)
  • to allow for light dismiss (but I'm not sure if that's already built in to a11y-dialog?)

It would make sense (to me) though, to default to non-modal dialogs when popover is added.

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

No branches or pull requests

3 participants