Expandable node is shown at wrong place, sorting broken after expand #1418
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.
If items limit is enabled, clicking on expandable element adds all elements before the node, so the sort order is totally wrong and "expandable node" appears "in the middle" of the siblings.
However, "hidden and now expanded" elements (if exists) should always be appended to the end of the shown children.
This is a regression from 5930a51 / #1331.
The problem with the patch above is that it inserts all previously hidden elements at the zero index in the tree, but the tree has already some children, so instead of adding new elements below existing, the patch prepends them.
Since #1331 consists of only two changes (changed tree item creation order on expand and updated javadoc), this is revert the former one.
Fixes #1417