MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / handleScroll

Function handleScroll

webview-ui/src/components/common/CodeBlock.tsx:307–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305 if (!preElement) return
306
307 const handleScroll = () => {
308 const isAtBottom =
309 Math.abs(preElement.scrollHeight - preElement.scrollTop - preElement.clientHeight) <
310 SCROLL_SNAP_TOLERANCE
311 wasScrolledUpRef.current = !isAtBottom
312 }
313
314 preElement.addEventListener("scroll", handleScroll, { passive: true })
315 // Initial check in case it starts scrolled up

Callers 1

CodeBlock.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected