Skip to content

popovertarget and shadow DOM #9109

@jpzwarte

Description

@jpzwarte

So in this example from https://html.spec.whatwg.org/multipage/popover.html#the-popover-target-attributes

<button popovertarget="foo" popovertargetaction="show">
  Show a popover
</button>

<article popover=auto id="foo">
  This is a popover article!
  <button popovertarget="foo" popovertargetaction="close">Close</button>
</article>

The close button will not work if <article> is a custom element instead. This is a pretty common thing with shadow DOM: ids are scoped to the shadow root.

It would be awesome though if the example above could work with custom elements.

Perhaps add popovertarget=":host" to the spec?

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementstopic: popoverThe popover attribute and friendstopic: shadowRelates to shadow trees (as defined in DOM)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions