Remove extra horizontal scrollbar space, improve row height estimation - #40
Closed
hovhannesmarikyan wants to merge 29 commits into
Closed
Remove extra horizontal scrollbar space, improve row height estimation#40hovhannesmarikyan wants to merge 29 commits into
hovhannesmarikyan wants to merge 29 commits into
Conversation
Fix test to perform click with the pointer events.
…t' into pre-release
`walkRowsInCol` does not clip scrolling rows at freezeY, so the last visible scrolling row's y-range crosses into the freeze band. Glide's normal flow relies on each column repainting the frozen row's fill after the scrolling walk to overwrite that overflow. With a wide `span` this short-circuits via `handledSpans` for every column after the first, leaving scrolling-row content visible inside the frozen span; per-column selection/highlight accents were also skipped for the same reason. Fall through with `skipContents=true` for sticky rows so each column repaints its own fill. Content stays drawn once by the initial span push. Non-frozen spans keep the short-circuit — they don't hit the overflow-into-freeze-band issue and rely on the wide-fill column for highlightRegions. Adds a regression test that fails without the fix.
`walkRowsInCol` does not clip scrolling rows at freezeY, so the last visible scrolling row's y-range crosses into the freeze band. Glide's normal flow relies on each column repainting the frozen row's fill after the scrolling walk to overwrite that overflow. With a wide `span` this short-circuits via `handledSpans` for every column after the first, leaving scrolling-row content visible inside the frozen span; per-column selection/highlight accents were also skipped for the same reason. Fall through with `skipContents=true` for sticky rows so each column repaints its own fill. Content stays drawn once by the initial span push. Non-frozen spans keep the short-circuit — they don't hit the overflow-into-freeze-band issue and rely on the wide-fill column for highlightRegions. Adds a regression test that fails without the fix.
Stop per-column repainting for spans in frozen trailing rows and restore single-pass span rendering. Clamp scrollable row walking and full redraw painting to the frozen-row boundary, with a sticky-span exception to avoid group-row seam darkening. Update tests for the new row count and span fill behavior.
The `onKeyDown` visible-region check treats frozen columns/rows as always out of view, since the tracked scrollable region excludes them by design. This silently blocks type-to-edit (pressing a character key to start editing) for any cell inside a frozen region, while Enter-to-edit and click-to-edit are unaffected since neither consults the visible region. Exempt cells inside `vr.extras.freezeRegions` from this check, mirroring the identical `isInFreezeArea` pattern already used in `getMangledCellContent`'s strict-mode branch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Header column reordering uses native HTML5 drag-and-drop. isActivelyDraggingHeader is set true on mousedown for header cells, but was only ever cleared in onMouseUp. Native DnD release delivers dragend, not mouseup, to the drag source, so the ref stayed stuck true after any header drag. Every subsequent mousemove then re-armed scrollDir from the live cursor position (see onMouseMoveImpl), driving the autoscroll RAF loop indefinitely with no mouse button held, until the user produced a real mouseup via an unrelated click. Reset both isActivelyDraggingHeader and scrollDir in onDragEnd, which already fires unconditionally on the native dragend event. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Coverage Report for CI Build 32818558472Coverage decreased (-0.04%) to 89.236%Details
Uncovered Changes
Coverage Regressions6 previously-covered lines in 2 files lost coverage.
Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The grid's ideal-height calculation always reserved vertical space for a horizontal scrollbar, even when the content didn't actually overflow horizontally — leaving dead space below the grid in the
common case where everything fits.
For variable row heights (rowHeight as a function), the estimate also averaged only the first 10 rows and extrapolated that average across the entire dataset. On large, heterogeneous datasets this
could be significantly off, producing an incorrect ideal height and, ironically, a spurious scrollbar of its own.
Change
single outlier row), then extrapolates the remainder from that average — instead of always averaging just the first 10 rows regardless of dataset size. This stays O(1)-ish for huge datasets while
being far more accurate than the old fixed 10-row average.