Re: [w3c/webcomponents] Need callback for form submit data (#187)

Hooking ```ShadowRoot``` doesn't sounds reasonable in this case because not all participating custom elements need a shadow tree. For example, making a contenteditable element submittable doesn't need a shadow tree.

```
class SubmittableRichEdit extends HTMLElement {
  constructor() {
    super();
    setAttribute('contentEditable', true);
  }
  formDataCallback(formData, form) {
    formData.append(getAttribute('name'), this.innerHTML);
  }
  formResetCallback() {
    this.textContent = '';
  }
}
```

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

Received on Wednesday, 28 February 2018 04:32:38 UTC