Repository navigation
Add keyboard navigation and row activation to QuickGrid - #70248
ilonatommy merged 8 commits into
Conversation
Co-authored-by: Copilot App <[email protected]>
Preserve the upstream virtualized ARIA row-count refresh together with real-data keyboard navigation bounds. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Focus restoration can fail in Firefox or target a nested grid, and repeated Space keydowns can cause unintended scrolling during row activation.
3 open issues
What changed in this PR
Adds keyboard navigation and activation to clickable QuickGrid rows while preserving native table semantics.
Changes:
- Makes rows with
OnRowClickfocusable and adds Enter/Space activation. - Adds focus recovery logic for replaced virtualized rows.
- Adds browser tests for keyboard activation and navigation that loads virtualized items.
| File | Description |
|---|---|
src/Components/test/testassets/BasicTestApp/QuickGridTest/QuickGridScrollComponent.razor |
Adds row activation callbacks to the scrolling test fixture. |
src/Components/test/E2ETest/Tests/QuickGridTest.cs |
Adds keyboard activation and virtualized navigation tests. |
src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor.js |
Handles keyboard activation and attempts focus recovery after row replacement. |
src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor.cs |
Documents keyboard activation for OnRowClick. |
src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor |
Adds conditional tabindex to clickable rows. |
Review effort: Balanced
Co-authored-by: Copilot App <[email protected]>
067d2cd to
7685e49
Compare
|
/review |
There was a problem hiding this comment.
Source-only review of frozen head 7685e497b7c0729d74a1fbe49ea0d7038c9fc215 found two P2 focus-restoration regressions, detailed inline.
Both routed guides completed independently with gpt-5.6-sol: Cross-Cutting Guidance and Blazor Components Guidance. The changed production path and E2E owner-layer coverage were assessed; browser/CI execution was excluded by the supplied-bundle boundary. No unresolved candidates or uncovered material changed areas remain.
Existing feedback was deduplicated neutrally: discussion r4467585882 (repeat-key scrolling), r4467585950 (restoration after removed focused rows), and r4467586000 (nested-grid selector scope) describe earlier code and are addressed in this frozen head; this is not an endorsement of those reviews. Feedback posted after bundle preparation is not observable.
Provenance: immutable version-2 bundle; head 7685e497b7c0729d74a1fbe49ea0d7038c9fc215, merge base f7d14ca402e8bb350148bfb64ad873e48c44f0b7, base tip and trusted guidance commit 1c94b15aa54d3d490d0ee060b7d496db3cb291e7. Proof is source-only. Tracked Git bytes only; symlink, submodule, and LFS targets cannot establish behavior.
Generated by ASP.NET Core Pull Request Review for #70248 · copilot · gpt56 · 174.8 AIC · ⌖ 12.3 AIC · ⊞ 18.8K
Comment /review to run again
PureWeen
left a comment
There was a problem hiding this comment.
Two additional focus-restoration issues remain at this commit: restoring a row can interrupt external editing or change the scroll position.
The browser evidence uses the unchanged module in Edge. It exercises native focus, DOM replacement, and scrolling, not a full QuickGrid application.
Human-directed and GitHub Copilot-generated.
Co-authored-by: Copilot App <[email protected]>
|
/review |
|
Copilot's local review panel found no blocking issues to raise at this commit. Informational note (for author confirmation only — does not block
|
Co-authored-by: Copilot App <[email protected]>
Can you describe it from user perspective? Do you have any videos of the behavior? What is the "active row index"? Will scrolling to a new batch of callback items in virtualize keep the Nth element focused regardless of was is in this element? |
Yes, I updated description for you to see the video. Unless people use tab too fast and virtualize is not able to load items in-time, then the scrolling is working correctly. |
I don't see the moment when rows are "replaced during scrolling". I think I still don't understand what happens then. |
"replaced" was actually meant to be "rerendered". Sorry for confusion :( |
|
/backport to release/11.0 |
|
Started backporting to |
|
Confidence that documentation is needed: 85% Drafted update to the QuickGrid article's OnRowClick Accessibility section for 12.0 keyboard behavior. Documentation surfaces considered
|
) * Add keyboard navigation for clickable QuickGrid rows * Simplify QuickGrid OnRowClick keyboard focus and activation * Address PR review feedback on QuickGrid keyboard focus and Space keydown * Refine QuickGrid row focus restoration on DOM replacement * Restore QuickGrid focus by row index * delete copied tests * feedback --------- Co-authored-by: Daria Tiurina <[email protected]> Co-authored-by: Copilot App <[email protected]>

Add keyboard navigation and row activation to QuickGrid
Enable keyboard focus and Enter/Space activation for clickable QuickGrid rows.
Description
QuickGrid rows with
OnRowClickcurrently respond to pointer clicks but are skipped by keyboard navigation. This change setstabindex="0"on clickable rows so they participate in the natural Tab order while preserving native table semantics and nested control focus behavior.Pressing Enter or Space when a clickable row is focused invokes its
OnRowClickcallback. When virtualized rows are rerendered, focus is preserved on the active row index (aria-rowindex).Video for QuickGrid with Virtualize
virtualize.tab.mp4
Fixes dotnet/aspnetcore-scenario-tests#157