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

API wise, including text in a slot seems a lot nicer than using an attribute. 
e.g.
`<copy-paste>lorem ipsum</copy-paste>`
is preferable to
`<copy-paste text="lorem ipsum"></copy-paste>`

However, if the user of the custom element then wants to programmatically change the text, the only way seems to be the ultra-verbose `document.querySelector('copy-paste').shadowRoot.querySelector('slot').assignedNodes()[0].data = 'something completely different'`

The `slotchange` event does not fire when this change occurs, so I guess the only way to monitor the change is with MutationObserver? (which again feels like an OTT solution)

-- 
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

Received on Sunday, 20 May 2018 18:22:23 UTC