MCPcopy Create free account
hub / github.com/bvaughn/react-window / clampOffset

Function clampOffset

lib/core/getOffsetForIndex.ts:43–46  ·  view source on GitHub ↗
(offset: number)

Source from the content-addressed store, hash-verified

41 });
42
43 const clampOffset = (offset: number) =>
44 clamp
45 ? Math.max(0, Math.min(estimatedTotalSize - containerSize, offset))
46 : offset;
47
48 const maxOffset = clampOffset(bounds.scrollOffset);
49 const minOffset = clamp

Callers 1

getOffsetForIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected