Rendering multiple nodes

Hi,

my cell creates multiple HTML elements. What are my options if I want to render them?

  1. return an array of elements -> does not work, is visualized as a JS structure
  2. return a DocumentFragment -> does not work, is visualized as a JS structure
  3. return a <div> containing those elements -> does work, seems awkward.

Would it make sense to have first or second option implemented as well?

You can render them as

html`${elements}`

Thanks, Mike! This works.

(Even though I still think that appending the returned DocumentFragment would be a very logical thing to do as well.)

The reason that we don’t display document fragments in the DOM (and instead inspect them) is that it’s destructive: the elements are removed from the fragment when being placed in the DOM. And thus if you refer to the cell’s value from another cell, the document fragment is now empty.

Bummer, that makes complete sense. :frowning_face:

(I would accept said cell to be a leaf or terminal node, i.e. not possible to be referenced from another one. But this is obviously a heavily non-systematic and complex change, so I am not even suggesting it.)