MCPcopy Create free account
hub / github.com/Noumena-Network/code / getMountedItemTopForClamp

Function getMountedItemTopForClamp

src/hooks/useVirtualScroll.ts:934–938  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

932 // offsets here, it can race ahead of what is actually mounted and expose a
933 // spacer flash. Cold-start/load/resize-settling still keep clamp disabled.
934 const getMountedItemTopForClamp = (index: number): number | undefined => {
935 const yoga = itemRefs.current.get(itemKeys[index]!)?.yogaNode
936 if (!yoga || yoga.getComputedWidth() === 0) return undefined
937 return yoga.getComputedTop()
938 }
939 const getMountedItemBottomForClamp = (index: number): number | undefined => {
940 const yoga = itemRefs.current.get(itemKeys[index]!)?.yogaNode
941 if (!yoga || yoga.getComputedWidth() === 0) return undefined

Callers 1

useVirtualScrollFunction · 0.85

Calls 3

getMethod · 0.45
getComputedWidthMethod · 0.45
getComputedTopMethod · 0.45

Tested by

no test coverage detected