You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
onBeforeClip exceptions leave the scroller inconsistent and busy #87
settings.onBeforeClip is called after rows are hidden and virtual padding is updated, but before their items are removed from the Buffer.
If the callback throws, clipping stops midway: the rendered list and Buffer become inconsistent, the workflow cycle remains busy, and adapter.relax() may never resolve.
Reproduction
Initialize a scroller with settings.infinite: true.
Scroll far enough to accumulate rows outside the visible area.
Configure onBeforeClip to throw an exception.
Call adapter.clip().
Clipping does not complete, and the scroller remains busy.
The same problem can occur during automatic clipping.
Expected
An exception from onBeforeClip must not leave clipping incomplete or the scroller stuck:
Finish clipping and any required viewport adjustment.
Finalize the cycle and restore consistent DOM/Buffer state.
Preserve and rethrow the original exception, including throw undefined.
Allow subsequent scrolling and Adapter operations to continue.
Do not lose a pending exception if the scroller is disposed before its deferred rethrow.
Closing in favor of the documentation changes in #88.
The PR makes a previously undocumented responsibility explicit: onBeforeClip must return normally, and the consumer must catch exceptions inside the callback without rethrowing. It also documents that escaping exceptions can interrupt clipping and leave the scroller inconsistent or busy.
Activity
dhilt commentedon Oct 21, 2026
Closing in favor of the documentation changes in #88.
The PR makes a previously undocumented responsibility explicit:
onBeforeClipmust return normally, and the consumer must catch exceptions inside the callback without rethrowing. It also documents that escaping exceptions can interrupt clipping and leave the scroller inconsistent or busy.Runtime behavior remains unchanged.