Frontmatter
| id | 8980 |
| title | Fix Grid Keyboard Navigation and Focus Layout Shift |
| state | Closed |
| labels | bugairefactoring |
| assignees | tobiu |
| createdAt | Feb 4, 2026, 12:31 PM |
| updatedAt | Feb 4, 2026, 12:32 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8980 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 4, 2026, 12:32 PM |
Fix Grid Keyboard Navigation and Focus Layout Shift

tobiu
Feb 4, 2026, 12:31 PM
Input from Gemini 3 Pro:
✦ Fixed Grid Keyboard Navigation & Layout Stability
Focus Restoration:
- Updated
GridBody.onRowClickto explicitly callthis.focus(this.vdom.id). This ensures the grid wrapper (which hastabIndex="-1") receives focus upon interaction, re-enabling keyboard navigation events.Layout Shift Prevention:
- Identified that focusing the grid body caused the browser to scroll the parent
GridContainer, pushing theHeaderToolbarout of view.- Updated
Neo.main.DomAccess.focusto support the{preventScroll: true}option for the nativeHTMLElement.focus()method.- Updated
Neo.component.Base.focusto accept and pass thepreventScrollargument.- Applied
preventScroll: trueto theGridBodyfocus call.This resolves the regression where row selection broke arrow-key navigation and caused visual jarring.
tobiu assigned to @tobiu on Feb 4, 2026, 12:31 PM
tobiu closed this issue on Feb 4, 2026, 12:32 PM
Problem: Keyboard navigation in the grid is broken. Selecting a row or cell no longer triggers focus on the grid body wrapper, preventing
KeyNavigationfrom capturing arrow key events. Additionally, focusing the body wrapper manually causes a layout shift where the header toolbar is scrolled out of view.Scope:
GridBodyreceives focus on row/cell clicks.preventScrollsupport forfocus()to stop the browser from scrolling the parent container.Changes Required:
src/main/DomAccess.mjs: Updatefocusto supportpreventScroll.src/component/Base.mjs: Updatefocussignature to passpreventScroll.src/grid/Body.mjs: Callthis.focus(this.vdom.id, false, true)inonRowClick.