Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a bug which was introduced in #4897.
The
finishSearchCallback
is not only called if the parent groups of the found node are expanded, but also when the tree data changes (where the parent groups of the found node are not expanded). I implemented a fix for that by checking for each element on the path whether it was actually expanded, but that was rather complicated. Therefore, I solved this issue in a more general way by updating theexpandedGroupIds
list whenever theonChange
handler of the sortable-tree is called because the tree data changed. This way the two structures are always in sync. I think this solution is much less error-prone and the performance impact should be negligible.URL of deployed dev instance (used for testing):
Steps to test:
The bug could be triggered as follows. Create a tracing with this structure:
Activate tree1 and then collapse groupA. Now change the visibility of groupB or tree2.
On master this would expand groupA again, which should no longer happen on this branch.
Also check whether group expansion, toggling of all sub groups works as before.