Skip to content

fix(render): use correct fallback row index in rerenderRows - #4932

Closed
lukecotter wants to merge 1 commit into
tabulator-tables:masterfrom
lukecotter:fix/render-rerender-fallback-index
Closed

fix(render): use correct fallback row index in rerenderRows#4932
lukecotter wants to merge 1 commit into
tabulator-tables:masterfrom
lukecotter:fix/render-rerender-fallback-index

Conversation

@lukecotter

Copy link
Copy Markdown
Contributor

Problem

rerenderRows falls back to the last row index when topRow === false, but writes
this.rows.length - 1. this.rows is a zero-arity method, so .length is 0 and
the expression is always -1.

Fix

Use this.rows().length - 1 — the last display-row index.

Performance

Neutral. 500k rows, K=5, medians (measured together with the follow-up filter-window
fix, see the dependent PR):

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

The rerenderRows anchor-scan fallback used `this.rows.length - 1`, but
`this.rows` is the method (arity 0), so the expression was always -1. When
the scan found no anchor row (stale or out-of-range rendered window), the
renderer filled from position -1 and left vDomTop negative. Use the last
display-row index instead.
@lukecotter

Copy link
Copy Markdown
Contributor Author

Folded into #4931, which now carries this fix unchanged as its own commit, so the four VirtualDomVertical state-tracking fixes are one review instead of four. Closing to keep the series small — happy to split it back out if you would rather review them separately.

@lukecotter lukecotter closed this Aug 4, 2026
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