tree: fix regression with re-expansion upon refresh