On Wed, 11 Mar 2026 01:16:54 GMT, Ziad El Midaoui <[email protected]> 
wrote:

> The bug occurs when showRoot is set to false on a root with no children, the 
> expanded item count drops is 0 causing `isFocused(0)` to return false even 
> though `focusedIndex` is still 0. When items are added afterwards the 
> `treeItemListener` sees `focusedIndex=0` and incorrectly shifts it to 1 
> placing the focus on second item of the `TreeTableView`.
> The fix replaces `isFocused(0)` with `getFocusedIndex() >= 0`, which reads 
> the raw stored index.

This pull request has now been integrated.

Changeset: 05006681
Author:    Ziad El Midaoui <[email protected]>
URL:       
https://git.openjdk.org/jfx/commit/0500668190ca16772f89b9a07987bc9df4c56fdc
Stats:     118 lines in 2 files changed: 117 ins; 0 del; 1 mod

8379662: TreeTableView: initial focused item incorrect

Reviewed-by: angorya, arapte

-------------

PR: https://git.openjdk.org/jfx/pull/2104

Reply via email to