Commit Graph
1 Commits
Author SHA1 Message Date
Charlie /andsycatle 29e20ae970 fix(js): implement Element scrollBy/scrollTo/scroll and functional scrollTop/scrollLeft (#431)
Element.prototype.scrollBy, scrollTo and scroll were undefined; they only
existed as no-ops on the window object. Scroll-driven infinite-scroll code
therefore threw "scrollBy is not a function", and scrollTop/scrollLeft were
no-op stubs that always read back 0.

Track a per-element scroll offset so scrollTop/scrollLeft round-trip, add the
three methods accepting either (x, y) or a ScrollToOptions object, and fire a
scroll event so listeners that drive lazy loading can advance. There is no
layout engine, so the offset is not clamped to a real overflow maximum.

Register the new methods in the native-function list so their toString stays
masked.

Fixes #429.

Co-authored-by: sycatle <sycatle@users.noreply.github.com>
2026-07-19 19:12:10 +00:00