Skip to content

Keep keyboard focus in the grid on Home/End jumps - #13021

Merged
niksedk merged 1 commit into
mainfrom
fix/tableview-home-end-focus
Jul 31, 2026
Merged

Keep keyboard focus in the grid on Home/End jumps#13021
niksedk merged 1 commit into
mainfrom
fix/tableview-home-end-focus

Conversation

@niksedk

@niksedk niksedk commented Jul 31, 2026

Copy link
Copy Markdown
Member

Follow-up to #13017. Since row containers took keyboard focus (#13015), a long Home/End scroll recycles the focused TableViewRow container and keyboard focus silently drops out of the grid. The main window key handler is gated on IsSubtitleGridFocused, so pressing End and then Home left the last row selected.

Fixes:

  • SelectAndScrollToRow re-focuses the newly selected row after the scroll, guarded by the grid's prior focus state so other callers never steal focus from the text box.
  • HandleShiftArrowSelection (Shift+Home/End/PageUp/PageDown) re-focuses the moving end of the selection.
  • TableViewExtras.AttachHomeEndNavigation (shared helper for the other grids) re-focuses the target row.

All three post the refocus via the dispatcher so it runs after layout has realized the target container; FocusRow falls back to focusing the TableView itself otherwise.

🤖 Generated with Claude Code

Since row containers took keyboard focus (#13015), a long Home/End scroll
recycles the focused TableViewRow and focus silently drops out of the
grid - the main window key handler is gated on IsSubtitleGridFocused, so
pressing End and then Home left the last row selected.

Re-focus the newly selected row after the scroll in SelectAndScrollToRow
(guarded so non-grid callers never steal focus), in the Shift+Home/End/
Page selection path, and in the shared AttachHomeEndNavigation helper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@niksedk
niksedk merged commit a3f2347 into main Jul 31, 2026
0 of 2 checks passed
@niksedk
niksedk deleted the fix/tableview-home-end-focus branch July 31, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant