Re: [w3ctag/design-reviews] Reference Target (Issue #961)

Would the use of `defaultReferenceTarget` or similar fail when moving from out "cannonical" example:
```html
<label for="input">Label</label>
<my-input id="input">
  <template shadowrootmode="open">
    <input id="input" defaultReferenceTarget>
  </template>
</my-input>
```
To one that took multiple targets, [as found here](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output):
```html
<form id="example-form">
  <input type="range" id="b" name="b" value="50" /> +
  <input type="number" id="a" name="a" value="10" /> =
  <output name="result" for="a b">60</output>
</form>
```
I will admit, it _is_ a bit contrived, but were this factored for reusability via the following, would "simply using the first instance of the attribute" be enough to make this work as expected?
```html
<form id="example-form">
  <calc-el>
    <template shadowrootmode="open">
      <input type="range" id="b" referenceTargetForAttributes="for" value="50" /> +
      <input type="number" id="a" referenceTargetForAttributes="for" value="10" /> =
    </template>
  </calc-el>
  <output name="result" for="a b">60</output>
</form>
```
- is this not expected/intended to be covered?
- did multiple targets via the map get covered?
- could there be multiple _default_ targets in either syntax? 👀 
  ```html
  <form id="example-form">
    <calc-el>
      <template shadowrootmode="open">
        <input type="range" id="b" defaultReferenceTarget value="50" /> +
        <input type="number" id="a" defaultReferenceTarget value="10" /> =
      </template>
    </calc-el>
    <output name="result" for="a b">60</output>
  </form>
  ```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/961#issuecomment-2449790664
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/961/2449790664@github.com>

Received on Thursday, 31 October 2024 13:02:23 UTC