JDK-8088157 : [TreeView, TreeTableView] Focus jumps to TreeItem sibling when child TreeItem is removed.
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • Submitted: 2013-02-01
  • Updated: 2022-04-22
  • Resolved: 2022-04-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Description
Test cases developed, but are currently @Ignored until a fix can be developed.

The two tests are:
javafx.scene.control.TreeViewTest.test_rt28114()
javafx.scene.control.TreeTableViewTest.test_rt28114()

Two related issues:

Issue 1: Steps to reproduce:
1) Open HelloTreeView
2) Click "Add child to Child Node 2" button multiple times
3) Expand "Child node 2"
4) Select the _last_ child of "Child node 2"
5) Click "Remove child from Child Node 2"
6) BUG: Selection has moved correctly, but focus has disappeared (most probably because both selection and focus models update focus)

Issue 2: Steps to reproduce:
1) Open HelloTreeView
2) Click "Add child to Child Node 2" button multiple times
3) Expand "Child node 2"
4) Select the _second to last_ child of "Child node 2"
5) Click "Remove child from Child Node 2"
6) BUG: Selection has moved correctly, but focus has moved up one row unexpectedly (most probably because both selection and focus models update focus)

As noted, in both cases the bug is likely due to the fact that both selection model and focus model listen to these events and update the focus independently.
Comments
Yes, the tests javafx.scene.control.TreeViewTest.test_rt28114() and javafx.scene.control.TreeTableViewTest.test_rt28114() were already passing before PR #753 [1]. [1] https://github.com/openjdk/jfx/pull/753
22-04-2022

It seems that this is no longer reproducible. See PR #753 [1] for details. [1] https://github.com/openjdk/jfx/pull/753 [~jpereda] Can you confirm and close as "Cannot reproduce" if this is the case?
22-04-2022