4 ms·
> Popovers created using the Popover API are always non-modal. If you want to create a modal popover, a <dialog> element is the right way to go. Why? This is a
by H1Supreme 2y ago
> Popovers created using the Popover API are always non-modal. If you want to create a modal popover, a <dialog> element is the right way to go.
Why? This is a legitimate use case for a popover. Especially if you're blurring the background while it's open. Why even offer that feature if a user's click can potentially trigger an action on some blurred out button.
*edit:
Apparently, you can combine the two:
> You can turn a <dialog> element into a popover (<dialog popover> is perfectly valid) if you want to combine popover control with dialog semantics.
Wouldn't <popover modal=true> make more sense here? They're clearly acknowledging a use case.
- eyelidlessness 2y agoProbably, among other things, because <dialog> existed much earlier.