- From: Matthew Robb <notifications@github.com>
- Date: Sun, 19 Feb 2017 20:04:33 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 20 February 2017 04:05:07 UTC
@csuwildcat Curious how you'd feel about a solving this problem through composition instead of direct inheritance. My thoughts stem from React and Higher Order Components that render out props.children.
```html
<my-field>
<input />
</my-field>
```
In the above case `<my-field>` doesn't have a traditional CE light/shadow dom. It becomes a virtual wrapper / proxy element for the `<input>`. By way of being a proxy element it would inherit the behavior and accessibility of the target.
Ideally this would be able to support arbitrary depths of nesting:
```html
<my-provider>
<my-behavior>
<select>
...
</select>
</my-behavior>
</my-provider>
```
>From the DOM perspective, selecting a decorator/proxy element would ultimately give you it's target.
You could define a decorator/proxy element the same way you do a custom element now but provide a flag to denote that it is a decorator/proxy.
@rniwa I'd be interested to hear what your thoughts on this are as well.
--
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/509#issuecomment-280983324
Received on Monday, 20 February 2017 04:05:07 UTC