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

Reference Target API #792

Open
Westbrook opened this issue Oct 7, 2024 · 0 comments
Open

Reference Target API #792

Westbrook opened this issue Oct 7, 2024 · 0 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@Westbrook
Copy link

Description

The Reference Target API allows forwarding attribute based content association across shadow DOM boundaries, a la:

<label for="fancy-input">Fancy input</label>
<fancy-input id="fancy-input">
  <template
    shadowrootmode="closed"
    shadowrootreferencetarget="real-input"
  >
    <input id="real-input">
  </template>
</fancy-input>

Or

<x-anchor id="x-anchor-1">
  <template shadowrootmode="open" shadowrootreferencetarget="anchor">
    <style>
      div {
        width: 100px;
        height: 100px;
      }
      #anchor {
        background-color: yellow;
      }
    </style>
    <div></div>
    <div id="anchor"></div>
  </template>
</x-anchor>
<div id="popover-1" popover anchor="x-anchor-1">Popover content</div>

Currently this feature is in Chrome Canary behind a flag and there was wide interest in bringing this to the web platform at various TPAC sessions in September.

Specification

https://github.com/WICG/webcomponents/blob/gh-pages/proposals/reference-target-explainer.md

Additional Signals

WPTs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
Status: No status
Development

No branches or pull requests

1 participant