Skip to content

fix(render): disable browser scroll anchoring on the table holder - #4935

Draft
lukecotter wants to merge 2 commits into
tabulator-tables:masterfrom
lukecotter:fix/render-holder-overflow-anchor
Draft

fix(render): disable browser scroll anchoring on the table holder#4935
lukecotter wants to merge 2 commits into
tabulator-tables:masterfrom
lukecotter:fix/render-holder-overflow-anchor

Conversation

@lukecotter

Copy link
Copy Markdown
Contributor

Problem

Chrome's scroll anchoring competes with the virtual renderer's padding writes. At the
bottom of a long list it pins scrollTop and the two fight in an infinite
oscillation — the renderer adjusts padding, anchoring restores the scroll offset, and
the cycle repeats every frame.

Fix

Set overflow-anchor: none on the table holder. The virtual renderer positions content
itself, so browser anchoring has nothing useful to contribute.

Test

test/e2e asserts the table holder disables scroll anchoring.

Performance

Neutral. 500k rows, K=5, medians:

Metric Before After
initial render (ms) 97.6 105.2
initial render, variable heights (ms) 105.6 109.0
fling churn, uniform 14205 14205
fling churn, variable 3935 3935

Chrome's scroll anchoring adjusts scrollTop when the virtual renderer inserts rows above the viewport, double-compensating against the renderer's own paddingTop/scrollTop management and causing drift on scroll-up. Set overflow-anchor:none on .tabulator-tableholder, the standard approach for JS-managed virtual scrollers.
e2e guard that .tabulator-tableholder computes overflow-anchor:none, so the
scroll-anchoring fix can't silently regress out of the built CSS.
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