diff --git a/TEST.md b/TEST.md index bd0a232..7dcf74e 100644 --- a/TEST.md +++ b/TEST.md @@ -34,3 +34,4 @@ - Successfully decoupled dynamic UI states (like `.dt-cell-selected`) from the declarative binding framework. We now use manual DOM manipulation (`applySelectionUI`) during `refresh` to sync states. - This manual sync completely prevents "Dependency Floods" where scrolling would trigger heavy `$class` evaluations on every cell. We maintained the Zero-Scan status while supporting rich interactions. - Fixed a VirtualScroll jumping bug at row 70+ by re-enabling `onItemUpdate` so VirtualScroll correctly learns the 40px row height instead of using its 32px default. + - **Scroll Initiation Fix**: Removed the `setTimeout` wrapper around `vs.init` during `reset`. Previously, the first scroll often hit a "blank wall" because VirtualScroll's internal metrics hadn't finished initializing when the user made their first swift scroll motion. Synchronous initialization resolved this completely. diff --git a/src/scroll.js b/src/scroll.js index 2a52092..afc6f34 100644 --- a/src/scroll.js +++ b/src/scroll.js @@ -30,11 +30,9 @@ export const createScrollManager = (container, state, onRenderedListChange) => { reset: (list) => { state._listStartIndex = 0; state._renderedList = vs.reset(list, scrollEl || container) || []; - setTimeout(() => { - if (state.list === list) { - vs.init(list, refresh); - } - }); + if (state.list === list) { + vs.init(list, refresh); + } }, updateRowHeight: (index, node) => { // Restore this call so VirtualScroll can learn the actual height