How to get a rich component added to TreeGrid using addComponentHierarchyColumn() have width of the column? No matter what I try, it seems to be bound by vaadin-grid-tree-toggle while vaadin-grid-cell-content has the correct full width. On other words, how to expand vaadin-grid-tree-toggle to use all width of vaadin-grid-cell-content?
Seems like the custom style of the internally used slot element is making problems. Normally, a slot just has a display: contents
, which allows its “children” to regulate their dimensions, but here it is set to display: block
. That means, that it has its own dimensions, which are using only minimal space.
I would recommend using css to solve this issue. For this your app needs to have a custom theme, where you have to set the toggle and its internal slot to full width. While the toggle width can be set somewhere in the light styles, e.g. the styles.css
vaadin-grid-tree-toggle {
width: 100%;
}
the slot part needs to be done using shadow dom styling, since it has no part
attribute assigned.
frontend/themes/your-theme/components/vaadin-grid-tree-toggle.css
slot {
width: 100%;
}
Hi @Stefan.27, thank you for the suggestion. Please let me try it. I’ll report back on the result.
Using both styles.css:
vaadin-grid-tree-toggle {
width: 100%;
}
and
frontend/themes/your-theme/components/vaadin-grid-tree-toggle.css
slot {
width: 100%;
}
worked. Thank you! I updated the Github ticket.