Avalonia.Controls.TreeDataGrid icon indicating copy to clipboard operation
Avalonia.Controls.TreeDataGrid copied to clipboard

Row Focus Order Does Not Match Visible Order

Open xLEGiON opened this issue 2 years ago • 1 comments

The Tab key can be used to change the focused cell. If the final cell of a row is focused, the focus will move to the next row.

If the TreeDataGrid contains enough rows to be scrolled and the user scrolls up/down, or if the source collection is modified (e.g. items being inserted), using Tab to change the focus to the next row will often make the focus switch to a seemingly random row instead of the next row visible to the user.

After inspecting the visual children of the TreeDataGridRowsPresenter during runtime, the focus order of the rows seems to match the order these rows appear in the AvaloniaList<Visual>, which won't always match the order the user sees the rows.

The expected behavior is that the row focus order matches the visible order.

Environment: TreeDataGrid Version: 11.0.2 Avalonia Version: 11.0.6 Operating System: Windows 10

xLEGiON avatar Feb 23 '24 14:02 xLEGiON

Adding a video to see the issue more clearly:

Row Focus Issue.webm

xLEGiON avatar Apr 06 '24 16:04 xLEGiON