LearnNewsExamplesServices
Frontmatter
id8983
titleFix Grid Scrollbar Position and DragScroll ID Mismatch
stateClosed
labels
bug
assigneestobiu
createdAtFeb 4, 2026, 1:20 PM
updatedAtFeb 4, 2026, 1:54 PM
githubUrlhttps://github.com/neomjs/neo/issues/8983
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 4, 2026, 1:54 PM

Fix Grid Scrollbar Position and DragScroll ID Mismatch

Closed v12.0.0 bug
tobiu
tobiu commented on Feb 4, 2026, 1:20 PM

Problem:

  1. Vertical Scrollbar moves horizontally: The vertical scrollbar scrolls with the content instead of staying pinned.
  2. GridDragScroll Regression: Horizontal drag scrolling is broken because ScrollManager passes the Component ID (id) instead of the rendered DOM ID (id__wrapper) to the GridDragScroll addon.

Fix:

  1. Revert to overflow-y: hidden: We changed resources/scss/src/grid/Container.scss from overflow-y: clip back to overflow-y: hidden on the inner .neo-grid-container.
    • Rationale: clip forces the parent wrapper (which has overflow-x: auto) to handle the scrolling. Since the vertical scrollbar is an absolute child of that wrapper, it scrolls away with the content. hidden creates a new Block Formatting Context (BFC) / Scroll Container on the inner element, trapping the wide content inside. This means the inner element scrolls, while the wrapper (and the scrollbar pinned to it) stays static.
  2. Focus Scroll Prevention: The reason we originally moved to clip was to prevent the browser from scrolling the grid body into view when focused (which sometimes pushed headers out). We solved this properly in src/grid/Body.mjs by passing {preventScroll: true} to the focus() method in onRowClick.
tobiu added the bug label on Feb 4, 2026, 1:20 PM
tobiu referenced in commit a92ab46 - "fix: Restore Grid Scrollbar position and diagonal scrolling (#8983)" on Feb 4, 2026, 1:53 PM
tobiu
tobiu Feb 4, 2026, 1:53 PM

Input from Gemini 3 Pro:

✦ I have resolved this issue.

Changes:

  1. Reverted SCSS: Changed resources/scss/src/grid/Container.scss back to overflow-y: hidden. This restores the correct scrolling behavior where the inner container scrolls while the wrapper (and the pinned scrollbar) remains static.
  2. Fixed Focus Logic: Updated src/grid/Body.mjs to use this.focus(this.vdom.id, false, true) in onRowClick. The true argument enables preventScroll, ensuring that focusing a row doesn't trigger unwanted browser scrolling behavior, which was the original reason for trying overflow-y: clip.
  3. Note on DragScroll: No changes were made to ScrollManager.mjs or GridDragScroll.mjs. The regression in drag scrolling was a side effect of the broken overflow behavior. Restoring the correct CSS fixed both issues.

I have pushed the changes to the feature branch.

tobiu assigned to @tobiu on Feb 4, 2026, 1:53 PM
tobiu closed this issue on Feb 4, 2026, 1:54 PM
tobiu
tobiu Feb 4, 2026, 1:54 PM

relates to #8981