I have a
FileTreeComponent showing a nested folder structure. When I expand some of them and then call
refresh(), they collapse. So I create an
OpennessRestorer before calling
refresh(), but that doesn’t work. The reason seems to be that
refresh() clears the list of children, so then we would have to wait for it to be filled asynchronously again.
restoreOpennessState() doesn’t seem to do that.
A small example that shows this: FileTreeTest.zip. In the example, I noticed that the initial expanding works if I uncomment line 47, to wait for the async/background update. I would like to avoid that line, if possible.
How can I fix this, or work around it?
There are some old topics on this, e.g. this one. You can find them by searching for “FileTreeComponent openness”.