Skip to content

feat(DataGrid): add Home/End keyboard navigation#199

Open
mathewtaylor wants to merge 2 commits intodevelopfrom
primitives/datagrid-home-end-navigation
Open

feat(DataGrid): add Home/End keyboard navigation#199
mathewtaylor wants to merge 2 commits intodevelopfrom
primitives/datagrid-home-end-navigation

Conversation

@mathewtaylor
Copy link
Contributor

Summary

  • Add Home key support to jump focus to the first row in the DataGrid
  • Add End key support to jump focus to the last row in the DataGrid
  • Prevent default browser scrolling for Home/End keys when a row is focused

Test plan

  • Focus a DataGrid row and press Home — verify focus moves to the first row
  • Focus a DataGrid row and press End — verify focus moves to the last row
  • Verify Home/End do not cause the page to scroll while a row is focused
  • Verify ArrowUp/ArrowDown/Space/Enter navigation still works as before

…t row

Wire up Home and End keys in the DataGrid row keyboard handler to move
focus to the first and last focusable rows respectively, matching standard
grid navigation conventions.
…ately

Clicking a row didn't reliably give the <tr> focus because Blazor uses
event delegation at the document root. Without focus, keydown handlers
(Home/End/ArrowUp/ArrowDown) never fired on the row. Explicitly focus the
row element via JS after a click when keyboard navigation is enabled.
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