TreeGrid in Dialog - reopen dialog collapse grid


I added TreeGrid to the dialog. When I open dialog first time tree grid has expanded items.
When i close dialog and reopen it all expanded items are collapsed and i see only root items.

Is there any magic that can leave expanded items after dialog close?


I think this is related to this issue:

Hard to say because I cannot expand grid after reopen. Expand method just don’t work.

Only creating new Object of TreeGrid helps.

In my opinion, when you close the dialog the grid is detached then reattached.
The grid component thinks the nodes is expanded (it’s in the list of expanded items) but the component does not expand the node. That’s probably the reason you can’t re-expand the item. (from this comment:

The fix should be in the next version of Vaadin 14.4.x. If the next version does not fix your issue then it’s something different.