Closed
Description
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.
Since #1331 consists of only two changes (changed tree item creation order on expand and updated javadoc), I would revert the former one.
The problem with the patch 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.
I will push a PR with a fix now.