Treeview with custom item-renderer renders only with styleName="full-width"

Hi,
when trying to implement item-renderer for treeviews I have encountered strange behaviour regarding width. Specifying width like this <item-renderer width="100%"> causes items to be render with zero width. On the other hand, if you specify it’s width via styleName like in the showcase <tree-view width="200" height="100%" styleName="full-width">. According to the default styles full-width sets width both to the itemrenderer and quite a bunch of other elements.
I have tried to wrap content of itemrender with but that didn’t help.
Is there any ingredience to making custom render work without full width? It’s mostly for clearing things up for anyone like me, who will try to copy from showcase and not realizing parent tree-view must have full-width style.

Tested on html5 target.

Hi :wave:

So yeah, as you note, treeview is a bit of a weird one, because its perfectly valid to want have both non full width items and full width items (in different trees ofc)… The problem arises because in order for <item-renderer width="100%"> to work correctly, a number of things also need to be 100% (otherwise they will get autosized, and therefore the rendererers will be calculated as “0” width)

I dont think there is really a way around that - one option would be to say “if the item renderer is 100% then lets assuming other things up the tree will want to be 100%” but i think its super messy and very prone to “wtf” moments.

Cheers,
Ian

Thanks for explaining.
Can I PR comment for the example in TreeView showcase or is ths one of the parts that will get retouched in the 2.0.?

I dont think its going to be different in V2 - at least i cant see how it would be any different