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?
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: https://github.com/vaadin/vaadin-grid/issues/1960#issuecomment-577210573).
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.