recalculateColumnWidth() for TreeGrid seems broken

I am trying to set the column-width of a TreeGrid such that the columns get the maximum width of the currently visible rows.

This now works by setting each column using:


After each expand action I trigger a tree.recalculateColumnWidths();

This works fine EXCEPT for the initial refresh and when expanding nodes:

  • In the initial display columns always have the width of the FIRST element only. Already expanded children are cut off at that width.
  • When expanding a node deeper down in the hierarchy the column width is adjust to the maximum width of the direct children only. But if deeper levels are already expanded and become visible as a side effect of this expand-action then they are again truncated.

I suspect this is a bug! The column-width calculation obviously only accounts for the width of direct children but not of deeper expanded and thus visible children.

Hope I could make myself clear. I could provide a couple of screen shots if needed to explain the issue.

Is there a better place to report bugs like this?

Michael Moser:
Is there a better place to report bugs like this?

Yes, bug reports should go to GitHub. Forum messages tend to get lost in history. In the case of (Tree)Grid, you should use the vaadin-grid repository:

Try to include exact steps to reproduce and a standalone test app where the error can be observed.