Re: [WICG/webcomponents] Reference Target: How to handle events fired on the reference target by related elements? (Issue #1098)

alice left a comment (WICG/webcomponents#1098)

Here's an example using `form` (thanks @jakearchibald) that might be helpful:

```html
<x-form id="x-form">
  <template shadowRootMode="open" referenceTarget="form">
    <form id="form"></form>
  </template>
</x-form>
<label>Name: <input form="x-form"></label>
<input type="submit" form="x-form">
```

If a user clicks the Submit button, it definitely seems like the page should get a chance to cancel the submission by listening for the `submit` event on `<x-form>`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/1098#issuecomment-2795845453
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/1098/2795845453@github.com>

Received on Friday, 11 April 2025 05:07:02 UTC