my cell creates multiple HTML elements. What are my options if I want to render them?
- return an array of elements -> does not work, is visualized as a JS structure
- return a DocumentFragment -> does not work, is visualized as a JS structure
- return a <div> containing those elements -> does work, seems awkward.
Would it make sense to have first or second option implemented as well?
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.
(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.)