Skip to content

[popover] Dialog with popover-like triggers #741

@una

Description

@una

When playing with popover recently, I ran into a scenario which I think will be relatively common: folks wanting dialog-like behavior (i.e. inerting content on the rest of the page when the dialog is open), with the developer ergonomics that popover and popovertoggle provide.

In this example, I wouldn't want the rest of the page to be interactive while one of the popovers is open (you can see that I can still hover and click on buttons behind the popover ::backdrop. Not ideal.

Kapture 2023-05-01 at 13 35 30

In this case, the popovers should probably be dialogs, but making them <dialog>, plus invoking them with .showModal() is the only way to get this behavior. Is there a way to get declarative popover-like developer ergonomics with dialog element semantics and behavior?

Some initial thoughts on solutions:

  1. A new value for the popover attribute to clarify behavior such as popover=modaldialog
  2. A seperate declarative trigger for dialog, such as dialogtarget=foo dialogtargetaction=modal (@mfreed7's suggestion)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions