On a TreeTableView, with multiple selection enabled, when a non-expanded non-leaf node, that has at least two levels of descendants, is selected, the selection grows unexpectedly to the next sibling of the top-level node, once a new treeItem is added to the second (or deeper) level of the selected item.
The attached test shows the issue.
- Node 0 (non-leaf) is selected and not expanded. It has as child Node 1, which also has Node 2 as child.
- Node 3 is a sibling of Node 0.
When Node 4 is added as sibling of Node 2, Node 3 gets selected unexpectedly (see attached picture).
This issue can be reproduced with any JavaFX version and platform.