Re: [w3c/webcomponents] changing slot text node is overly verbose (#753)

What are use cases of mutating text nodes assigned to a slot?  That comes off as an anti-pattern.  If a component exposes an API to set some text (e.g. label) for rendering, then that text should exist as a regular text node inside the component's shadow tree.  If the API is instead a slot, then the user of the component should be mutating the text nodes directly.

There is literally no builtin element that behaves this way. e.g. `textarea` element uses its children as the default value of the text field but what the setter of [`defaultValue`](https://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-defaultvalue) does is to replace all children of `textarea` element, not just text nodes.

-- 
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/753#issuecomment-390840604

Received on Tuesday, 22 May 2018 02:12:54 UTC